Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
consiliens opened this Issue · 3 comments

2 participants

@consiliens

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

https://gist.github.com/999252

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


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

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.
"

http://code.google.com/p/mirah/issues/detail?id=68

@baroquebobcat

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

@baroquebobcat

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

@baroquebobcat

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.

https://gist.github.com/rdp/999252

#...
c = RubyObj(nil)
c = RubyInt.new()
RubyInt.new().times do |n|
  c = ImplementsPlusOneArg(c).plus n # could also raise at compile time, since it's assigning c to an Object without casting.
end
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.