Actions
Bug #20741
closedRubyVM::InstructionSequence.compile emits a wrong warning (prism?)
    Bug #20741:
    RubyVM::InstructionSequence.compile emits a wrong warning (prism?)
  
Description
$ ./local/bin/ruby -we 'p RubyVM::InstructionSequence.compile("42").eval'
<compiled>:1: warning: possibly useless use of a literal in void context
42
        
           Updated by byroot (Jean Boussier) about 1 year ago
          Updated by byroot (Jean Boussier) about 1 year ago
          
          
        
        
      
      prism?
Yes:
$ ./miniruby --parser=parse.y -we 'p RubyVM::InstructionSequence.compile("42").eval'
42
$ ./miniruby --parser=prism -we 'p RubyVM::InstructionSequence.compile("42").eval'
<compiled>:1: warning: possibly useless use of a literal in void context
42
        
           Updated by kddnewton (Kevin Newton) about 1 year ago
          Updated by kddnewton (Kevin Newton) about 1 year ago
          
          
        
        
      
      I have submitted a PR that will fix this https://github.com/ruby/ruby/pull/11632.
        
           Updated by kddnewton (Kevin Newton) about 1 year ago
          Updated by kddnewton (Kevin Newton) about 1 year ago
          
          
        
        
      
      - Status changed from Open to Closed
Actions