private static inline var foo : Int = 100;
private static inline var uncleFoo : Int = foo * 100;
Source/Whatever.hx:00: characters XX-YY : Inline variable initialization must be a constant value
private static inline var foo : Int = 100;
private static inline var myStaticPoint2 : Point = new Point (foo, foo * 5);
private static inline var strFoo : String = "my const text";
Oups, I made a mistake here, it's not about primitives at all. Silly me, sorry :)
Here's what I actually meant:
private static inline var myStaticPoint : Point = new Point (10, 10);
or even:
private static inline var foo : Int = 100;
private static inline var myStaticPoint2 : Point = new Point (foo, foo * 5);
Inlining that was previously allowed but would lead to
surprising results because usage of the variable would create a
new instance on each access. That's why it was forbidden in Haxe
3.
Simon
What was working in haxe 2 doesn't work anymore :
public static inline var ZERO : V2D = new V2D(0, 0);
I get this error :
Variable initialization must be a constant value.How do I initialize static inline variable with an object (which is actually constant) ?
if it's a constant it's not an inline:
public static var ZERO(default,never) : V2D = new V2D(0, 0);
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.