Project

General

Profile

Actions

Bug #20736

closed

prism emits wrong warnings in syntax-error code

Added by mame (Yusuke Endoh) 2 months ago. Updated 2 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 (1 open0 closed)

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like1Like0