No Int to Long literal conversion in generated java code
WebDSL code:
function minutes(x : Long) : Long { var factor : Long := 60; return seconds(x * factor); }
Generated Java code:
Long minutes_factor0 = 60;
Javac error:
Submitted by Eelco Visser on 19 March 2010 at 10:31minutes_.java:26: incompatible types found : int required: java.lang.Long Long minutes_factor0 = 60;
Issue Log
On 26 January 2012 at 15:07 Eelco Visser commented:
Workaround: Use L postfix of constant value.
function minutes(x : Long) : Long {
var factor : Long := 60L;
return seconds(x * factor);
}
On 26 January 2012 at 15:09 Eelco Visser commented:
Related occurrence of the problem:
entity Counter { current :: Long (default=0) }error:
setCurrent(java.lang.Long) in webdsl.generated.domain.Counter cannot be applied to (int)
this.setCurrent(0);
On 26 January 2012 at 20:08 Eelco Visser commented:
Another example:
entity Ent {
i :: Long
}
var e1 := Ent{ i := 5 }
Log in to post comments