Skip to content

Instantly share code, notes, and snippets.

@maltoe
Created March 17, 2015 10:07
Show Gist options
  • Save maltoe/b43657ffb88f5f178340 to your computer and use it in GitHub Desktop.
Save maltoe/b43657ffb88f5f178340 to your computer and use it in GitHub Desktop.
stacktrace for rubinius case-when issue
$ rbx compile test.rb >log 2>&1
Failed compiling test.rb
An exception occurred running compile:
undefined method `body' on an instance of CodeTools::AST::PushArgs. (NoMethodError)
Backtrace:
Kernel(CodeTools::AST::PushArgs)#body (method_missing) at kernel/delta/kernel.rb:78
CodeTools::AST::When#receiver_bytecode at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/control_flow.rbc:139
{ } in CodeTools::AST::ReceiverCase#bytecode at /tmp/ruby-build.20150311174222.907/rubinius-2.5.2/staging/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/control_flow.rb:66
Array#each at kernel/bootstrap/array.rb:76
CodeTools::AST::ReceiverCase#bytecode at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/control_flow.rbc:65
{ } in CodeTools::AST::Block#bytecode at /tmp/ruby-build.20150311174222.907/rubinius-2.5.2/staging/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/definitions.rb:96
{ } in Enumerable(Array)#each_with_index at kernel/common/enumerable.rb:234
Array#each at kernel/bootstrap/array.rb:76
Enumerable(Array)#each_with_index at kernel/common/enumerable.rb:232
CodeTools::AST::Block#bytecode at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/definitions.rbc:94
{ } in CodeTools::AST::Script#bytecode at /tmp/ruby-build.20150311174222.907/rubinius-2.5.2/staging/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/definitions.rb:1222
CodeTools::AST::Container(CodeTools::AST::Script)#container_bytecode at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/definitions.rbc:1106
CodeTools::AST::Script#bytecode at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-ast-2.3.1/lib/rubinius/ast/definitions.rbc:1221
CodeTools::Compiler::Bytecode#run at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-compiler-2.3.1/lib/rubinius/compiler/stages.rbc:153
CodeTools::Compiler::Stage(CodeTools::Compiler::FileParser)#run_next at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-compiler-2.3.1/lib/rubinius/compiler/stages.rbc:53
CodeTools::Compiler::Parser(CodeTools::Compiler::FileParser)#run at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-compiler-2.3.1/lib/rubinius/compiler/stages.rbc:210
CodeTools::Compiler#run at /home/malte/.rbenv/versions/rbx-2.5.2/runtime/gems/rubinius-compiler-2.3.1/lib/rubinius/compiler/compiler.rbc:359
{ } in CompilerScript#compile_files at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:203
CompilerScript#protect at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:146
{ } in CompilerScript#compile_files at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:195
Array#each at kernel/bootstrap/array.rb:76
CompilerScript#compile_files at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:185
CompilerScript#main at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:236
Object#__script__ at /home/malte/.rbenv/versions/rbx-2.5.2/library/bin/compile.rb:240
Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152
Rubinius::Loader#script at kernel/loader.rb:655
Rubinius::Loader#main at kernel/loader.rb:809
a = [1, 2]
case 3
when 3, *a
puts 'works'
when *a, 3
puts 'compiler error, but works in MRI'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment