Skip to content

squiggly heredoc with single quotes fails to run #4169

@pbl-pw

Description

@pbl-pw

test code:

obj = <<~'TEST'
    hello
TEST

puts obj

report error:

Unhandled Java exception: java.lang.ClassCastException: org.jruby.util.ByteList cannot be cast to org.jruby.ast.Node
java.lang.ClassCastException: org.jruby.util.ByteList cannot be cast to org.jruby.ast.Node
                     execute at org/jruby/parser/RubyParser.java:4501
                     yyparse at org/jruby/parser/RubyParser.java:1678
                     yyparse at org/jruby/parser/RubyParser.java:1569
                       parse at org/jruby/parser/RubyParser.java:5359
                       parse at org/jruby/parser/Parser.java:121
                       parse at org/jruby/parser/Parser.java:103
          parseFileAndGetAST at org/jruby/Ruby.java:2772
  parseFileFromMainAndGetAST at org/jruby/Ruby.java:2765
           parseFileFromMain at org/jruby/Ruby.java:2753
               parseFromMain at org/jruby/Ruby.java:613
                 runFromMain at org/jruby/Ruby.java:559
               doRunFromMain at org/jruby/Main.java:425
                 internalRun at org/jruby/Main.java:313
                         run at org/jruby/Main.java:242
                        main at org/jruby/Main.java:204

but <<~TEST or <<~"TEST" both ok.

Environment

  • jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) Client VM 25.101-b13 on 1.8.0_101-b13 +jit [mswin32-x86]
  • Windows 10 x64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions