From: shevegen@... Date: 2016-06-21T04:37:51+00:00 Subject: [ruby-core:76094] [Ruby trunk Bug#12493] Confusing did_you_mean error Issue #12493 has been updated by Robert A. Heiler. I guess the trivial fix would be to: "if the name would be the same name, do not suggest an alternative name" (since the alternative name would be == to the reported name) Has someone reported this on the github issue tracker for the did you mean it gem? Perhaps the gem author has not yet seen this report here. ---------------------------------------- Bug #12493: Confusing did_you_mean error https://bugs.ruby-lang.org/issues/12493#change-59293 * Author: Guo Xiang Tan * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- ``` 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 `
' ``` I think assignment in a one liner if statement isn't encouraged but I found the suggestion to be quite confusing. -- https://bugs.ruby-lang.org/ Unsubscribe: