Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Issue 61: ICE with an empty block #110
import java.util.ArrayList interface CallableOneArg do def call(arg1:Object):Object end end # should I make this class static? cache it [in a hash]? class RubyInt < Object def times(call_me:CallableOneArg):Object self end end RubyInt.new.times do |n| end
=> Mirah::InternalCompilerError: undefined method `each' for nil:NilClass
0a826dd fixes this.
The problem was that a Block with an empty body was being transformed into an AST node with a nil body.
The code was blowing up where it checked for children of the body because the body was nil. Now the body will be an AST node with no children.