Project

General

Profile

Actions

Bug #12493

closed

Confusing did_you_mean error

Added by tgxworld (Guo Xiang Tan) over 8 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[ruby-core:76032]

Description

 irb(main):001:0> test = some_string if (some_string = "test")
(irb):1: warning: found = in conditional, should be ==
NameError: undefined local variable or method `some_string' for main:Object
Did you mean?  some_string
	from (irb):1
	from /home/tgxworld/.rbenv/versions/2.3.1/bin/irb:11:in `<main>'

I think assignment in a one liner if statement isn't encouraged but I found the suggestion to be quite confusing.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0