Bug #20401
closedDuplicated when clause warning line number
Description
When you have a duplicated when clause, you get a warning for it. For example:
you get warning: duplicated `when' clause with line 2 is ignored.
But the when clause that is ignored is the one on line 4, not line 2. It seems like it's warning for the wrong line.
Updated by kddnewton (Kevin Newton) over 2 years ago
Updated by mame (Yusuke Endoh) over 2 years ago
This behavior was discovered and briefly discussed during the previous dev meeting. The actual warning is
According to @nobu (Nobuyoshi Nakada), this reads "The 'when' clause at line 4 duplicates (conflicts) with (a 'when' clause at) line 2. This is ignored."
Anyway I agree that it is too confusing. I think it would be good if they could improve the English.
Updated by nobu (Nobuyoshi Nakada) over 2 years ago
- Description updated (diff)
Updated by kddnewton (Kevin Newton) about 2 years ago
I've updated the message to say:
I hope this is okay, I believe it is much more clear. The PR is here: https://github.com/ruby/ruby/pull/10776. @nobu (Nobuyoshi Nakada) or @mame (Yusuke Endoh) could you review?
Updated by kddnewton (Kevin Newton) about 2 years ago
I've merged it for now. Happy to revert or change further if there's any more feedback!
Updated by kddnewton (Kevin Newton) about 2 years ago
- Status changed from Open to Closed