New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

squiggly heredoc with single quotes fails to run #4169

pbl-pw opened this Issue Sep 22, 2016 · 1 comment


None yet
2 participants

pbl-pw commented Sep 22, 2016

test code:

obj = <<~'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/
                     yyparse at org/jruby/parser/
                     yyparse at org/jruby/parser/
                       parse at org/jruby/parser/
                       parse at org/jruby/parser/
                       parse at org/jruby/parser/
          parseFileAndGetAST at org/jruby/
  parseFileFromMainAndGetAST at org/jruby/
           parseFileFromMain at org/jruby/
               parseFromMain at org/jruby/
                 runFromMain at org/jruby/
               doRunFromMain at org/jruby/
                 internalRun at org/jruby/
                         run at org/jruby/
                        main at org/jruby/

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


  • jruby (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

This comment has been minimized.

Show comment
Hide comment

headius Sep 22, 2016




headius commented Sep 22, 2016


@headius headius added this to the JRuby milestone Sep 22, 2016

@enebo enebo closed this in 9bbcd84 Sep 22, 2016

yarmiganosca added a commit to yarmiganosca/spinach that referenced this issue Aug 21, 2018

upgrade jruby to get around capybara syntax issue in jruby test runs
We routinely see an error in JRuby runs on Travis when loading the file capybara/node/actions.
The reason for this is that it contains squiggly heredocs with delimiters with quotes (<<~'JS' to be specific).

JRuby couldn't parse squiggly heredocs with single quotes in the delimeter until
link: jruby/jruby#4169

Because capybara isn't a runtime dependency for spinach, making our JRuby runs on Travis use a newer version of JRuby doesn't actually affect our users.
The alternative, getting capybara's maintainers to accept a PR removing the quotes from the heredoc delimeters in that file, seems like it would take much more effort, for very little benefit.

As a side note, I have no clue what the benefit of adding quotes (single or double) to a heredoc delimeter is. Those capybara heredocs work fine with or without quotes in the delimeter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment