Project

General

Profile

Actions

Feature #20244

closed

Show the conflicting another chdir block

Added by nobu (Nobuyoshi Nakada) 10 months ago. Updated 8 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:116621]

Description

Dir.chdir is warning when in another chdir block.

$ ruby -e 'Dir.chdir {' -e 'Dir.chdir("/")' -e '}'
-e:2: warning: conflicting chdir during another chdir block

If two chdirs are far apart, it can be difficult to find conflicting blocks.

To help the debugging, I propose to improve the warning message to show the conflicting block.

$ ./ruby -e 'Dir.chdir {' -e 'Dir.chdir("/")' -e '}'
-e:2: warning: conflicting chdir during another chdir block
-e:1: warning: here

https://github.com/ruby/ruby/pull/9870

Actions

Also available in: Atom PDF

Like1
Like0