Skip to content

Issue 59: inferred type appears wrong? #108

@consiliens

Description

@consiliens

"
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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions