[ruby-core:99633] [Ruby master Bug#17124] Wrong "ambiguous first argument" warning
From:
marcandre-ruby-core@...
Date:
2020-08-18 20:02:54 UTC
List:
ruby-core #99633
Issue #17124 has been reported by marcandre (Marc-Andre Lafortune). ---------------------------------------- Bug #17124: Wrong "ambiguous first argument" warning https://bugs.ruby-lang.org/issues/17124 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- ```sh $ ruby -v -e "x='a'; x.match? /[a-z]/" ruby 2.8.0dev (2020-07-30T14:07:06Z master 352895b751) [x86_64-darwin18] -e:1: warning: ambiguous first argument; put parentheses or a space even after `/' operator ``` There is no `/' operator in there and there is also no ambiguity as adding a space after the first `/` is a syntax error. Is it possible to remove the warning altogether when the argument is lexed as a regexp? The message could use a rewording too, maybe "ambiguous first argument; put parentheses around argument or add a space after `/' operator" -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>