Problems converting AS3 static inline constants and functions

This line is allowed in Actionscript 3:

public static inline const LIST:Array = [“item1”,“item2”,"item3];

This line in Haxe throws a build error:

public static inline var LIST:Array = [“item1”,“item2”,"item3];

If I change that to:

public var LIST:Array = [“item1”,“item2”,"item3];

then the static functions that access LIST throws the error “Cannot access LIST in static function”

Is this a Haxe problem or is the problem that the compiler I’m using cannot handle it? I’m building to HTML5.

Got this solution from someone in the Haxe community:

public static final LIST:haxe.ds.ReadOnlyArray = [“item1”,“item2”,"item3];

2 Likes