You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduced. When you create a block that has a different signature than the interface it's supposed to be implementing, we don't complain and generate invalid code.
interfaceMyInterfacedodefrun(a:int):int;endenddefgo(block:MyInterface)block.run(3)endgo{b=4}#the closure class here has a #run() method not #run(int x)
"
Reported by rogerpack2005, May 28, 2011
As described
http://groups.google.com/group/mirah/browse_thread/thread/ea8b610c2771df4a
interface MyInterface do
def run():int; end
end
def go(block:MyInterface)
block.run()
end
a = 3
go { b = 4 }
I think should work, but doesn't.
$ mirah yoyo.mr
Inference Error:
yoyo.mr:11: Inferred return type Type(void) is incompatible with declared Type(int)
go { b = 4 }
it should be inferring return type int, I think.
Other incantations that I "think" should work but don't (possibly related):
interface MyInterface do
def run(a:int):int; end
end
def go(block:MyInterface)
block.run(3)
end
a = 3
go { b = 4 }
(same error)
and
interface MyInterface do
def run(a:int):int; end
end
def go(block:MyInterface)
block.run(3)
end
a = 3
go {|n| a = 4}
...
yoyo.mr:10:in `main': java.lang.VerifyError: (class: Yoyo/mr$__xform_tmp_2, method: run signature: (I)I) Unable to pop operand off an empty stack
v0.0.7
Comment 1 by rogerpack2005, May 28, 2011
actually the first example works now, the rest still fail
Comment 2 by rogerpack2005, May 30, 2011
maybe related to #37 ?
"
http://code.google.com/p/mirah/issues/detail?id=59
The text was updated successfully, but these errors were encountered: