Project

General

Profile

Actions

Bug #20736

closed

prism emits wrong warnings in syntax-error code

Added by mame (Yusuke Endoh) 7 months ago. Updated 7 months ago.

Status:
Feedback
Target version:
-
[ruby-core:119163]

Description

$ ./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

Related issues 1 (0 open1 closed)

Related to Ruby - Bug #20817: Ruby 3.4.0dev emits `warning: possibly useless use of + in void context` while Ruby 3.3.5 does notRejectedprismActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like1Like0