New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InternalCompilerError: undefined method `compatible?' for nil:NilClass #157
Comments
Interestingly, if I tweak the return value/type of that |
A more succinct test case: class ContentType
def getContentLength:long
begin
return getLengthOfParts
rescue Exception => e
return long(0)
end
end
def getLengthOfParts:long
long(1)
end
end |
Funnily, these are actually two separate bugs. The first one is because we do inference on ensure as though it is an expression, even though ensure's never have a return type. https://github.com/mirah/mirah/blob/master/lib/mirah/ast/flow.rb#L373-377 class Ensure < Node
child :body
child :clause
attr_accessor :state # Used by some compilers.
def initialize(parent, position, &block)
super(parent, position, &block)
end
def infer(typer, expression)
resolve_if(typer) do
typer.infer(clause, false)
typer.infer(body, true) # << true should be false here
end
end
end The second will take a bit more to tease out, but I'm guessing it has something to do with return not having a type & it needing to be special cased. |
What do you think of abscondment@2fddffe for the 2nd issue? |
looks ok to me, add some test cases in test/jvm/test_rescue.rb that cover the new cases and open a pull request. |
Thanks. |
Updating my project to 0.0.10 from 0.0.9 showed a new compilation snag:
Git bisect between 0.0.9 and 0.0.10 pins it on 677e4aa
I don't quite grok what's going on here, but I have a test case to help in fixing things: https://gist.github.com/1478479
The text was updated successfully, but these errors were encountered: