-
Notifications
You must be signed in to change notification settings - Fork 62
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
Assigning long to value to Long field triggers VerifyError #45
Comments
"Comment 1 by rogerpack2005, May 28, 2011 |
I think this is conflating two issues.
when I run
I get
for a response |
Interestingly, while
compiling to java source generates good output that compiles and runs correctly.
DashE.java // Generated from DashE
public class DashE extends java.lang.Object {
private static java.lang.Long a;
public static void main(java.lang.String[] argv) {
DashE.a = ((java.lang.Long)(null));
DashE.a = java.lang.Long.parseLong("1297");
}
} |
I think it's a type coercion issue because when you use
|
Ran it w/
currently, inference on field assignment doesn't do all the type checking it should. def learn_static_field_type(cls, name, type)
log "Learned field type under #{cls} : #{name} = #{type}" if type
# TODO check for compatibility?
static_field_type_hash(cls)[name] ||= known_types[type] || type
type
end local inference does, which is why you get an inference error rather than a runtime error. The other interesting thing is that |
this is a boxing / unboxing problem. |
What I am doing here is oviously wrong, but this should be caught at compile time I think.
The text was updated successfully, but these errors were encountered: