Skip to content

Truffle - Compile Error until when break in case statement #2654

Closed
@bjfish

Description

@bjfish

This fails with the following error in Truffle but not in jruby or ruby 2.2

       x = 0
       until x > 5
          test = "test"
          case
          when test == "hello"
             break unless test == "foo"
             puts "hello"
          when test == "te"
            if test == "false"
              raise "foo"
            end
            break
          else
            puts "else"
          end
          x += 1
      end

Error output

jruby: using Default Truffle Runtime
whenbreak.rb:13: Invalid break
whenbreak.rb: compile error (SyntaxError)

Expected output

else
else
else
else
else
else

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions