Weird warning with extern classes


(Remco Huijser) #1
extern class Name
    public static var variable : Float;

Gives me the warning: “Extern non-inline function may not have an expression”
This used to work fine in older Haxe versions (using 4 preview 4).

Anyone recognizes this?

(Simon Krajewski) #2

That code by itself doesn’t cause such an error. Are there any build macros or something running?

(Remco Huijser) #3

Quite a long time ago I posted this, but it indeed turned out I was generating a constructor for extern classes. Quick check fixed the issue. Thanks @Simn

(Aartzrc) #4

I have a project using js-kit ( with this quirk. Currently compiling with Haxe 4.0.0-rc.1. Everything functions fine, but having a long list of warnings pop up is a little disconcerting. Is there a way to suppress the warning for a specific library or file with a compiler flag?

The exact warning is:

D:\HaxeToolkit\haxe\lib\js-kit/git/js/npm/express/Middleware.hx:22: characters 2-8 : Warning : Extern non-inline function may not have an expression