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
Issue 79: Mirah::InternalCompilerError: No constructor #128
Comments
@rdp, what would you expect super to do in import java.util.ArrayList
class A < ArrayList
def initialize(o:java.util.List)
super
end
end call Also, if it were import java.util.ArrayList
class A < ArrayList
def initialize(o:java.util.List)
super o
end
end Would that call |
I think so, isn't that what it does in java? |
I get The basic problem is that somewhere we are not widening the argument to super. |
This is using Ruby semantics for initialization super delegation. In Ruby, def initialize x
super
end means call super with my args. You have to change how you use super to make it more specific You can have the behavior you expect by doing def initialize o: List
super()
end You could also do def initialize o: List
super o.size
end
Yeah, I'm not entirely sure why that is. Maybe something changed to require double colons instead of periods as a package separator. |
I'm closing this. After reading more of the implementation this looks like intended behavior. I've added some more tests to better specify it. |
Mirah's super acts like Ruby's--which has some quirks. #128
Mirah's super acts like Ruby's--which has some quirks. #128
"
Reported by rogerpack2005, Jun 3, 2011
this java:
compiles, but this mirah:
does not:
...
Mirah::InternalCompilerError: No constructor
java.util.ArrayList(Type(java.util.List))
ref: http://groups.google.com/group/mirah/browse_thread/thread/dfd77751fc0902c5
"
http://code.google.com/p/mirah/issues/detail?id=79
The text was updated successfully, but these errors were encountered: