
Issue #20736 has been updated by mame (Yusuke Endoh). Although I can understand the technical reason, I still feel a bit uncomfortable when the warning says “use of a literal” since `9a` is clearly not a literal to the human eye. As a practical matter, this behavior causes a lot of warnings when you `make test-all RUBYOPT=-w`. Should we work around it by setting `$VERBOSE = nil`? ``` [19134/33573] TestRubyLiteral#test_string(eval at /home/chkbuild/chkbuild/tmp/build/20240913T183003Z/ruby/test/ruby/test_literal.rb:65):1: warning: possibly useless use of a literal in void context (eval at /home/chkbuild/chkbuild/tmp/build/20240913T183003Z/ruby/test/ruby/test_literal.rb:68):1: warning: possibly useless use of a literal in void context (eval at /home/chkbuild/chkbuild/tmp/build/20240913T183003Z/ruby/test/ruby/test_literal.rb:71):1: warning: possibly useless use of a literal in void context (eval at /home/chkbuild/chkbuild/tmp/build/20240913T183003Z/ruby/test/ruby/test_literal.rb:74):1: warning: possibly useless use of a literal in void context ... ``` ---------------------------------------- Bug #20736: prism emits wrong warnings in syntax-error code https://bugs.ruby-lang.org/issues/20736#change-109771 * Author: mame (Yusuke Endoh) * Status: Feedback * Assignee: kddnewton (Kevin Newton) * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ``` $ ./local/bin/ruby -w --parser=parse.y -e 'begin eval("0a"); rescue SyntaxError; end' $ ./local/bin/ruby -w --parser=prism -e 'begin eval("0a"); rescue SyntaxError; end' (eval at -e:1):1: warning: possibly useless use of a literal in void context ``` ``` $ ./local/bin/ruby -w --parser=parse.y -e 'begin eval("+a.0"); rescue SyntaxError; end' $ ./local/bin/ruby -w --parser=prism -e 'begin eval("+a.0"); rescue SyntaxError; end' (eval at -e:1):1: warning: possibly useless use of +@ in void context ``` -- https://bugs.ruby-lang.org/