Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Issue 68: not checking for types within block correctly #117

consiliens opened this Issue · 3 comments

2 participants


Reported by rogerpack2005, May 30, 2011
mirah not checking for the return type correctly, apparently, in this gist:

javac catches the problem, mirahc doesn't, however :)

Comment 1 by rogerpack2005, May 30, 2011
Actually there may be two problems here.

Exception in thread "main" java.lang.NoSuchFieldError: c

I think is caused by mirah emitting the wrong bytecode, because if I use javac to compile the outputted file mirahc -j file, it doesn't give me that error.


Hrm. I get expected statement before '  def plus(o:' (at line: 5, char: 1) from this.


now gets a java.lang.VerifyError: Operand stack underflow in method DashE$;)Ljava/lang/Object; at offset 19


This appears to be a problem w/ an assignment to a closed over variable. Somehow the bytecode generated for the closure body isn't quite right.

c = RubyObj(nil)
c = do |n|
  c = ImplementsPlusOneArg(c).plus n # could also raise at compile time, since it's assigning c to an Object without casting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.