haxe
haxe copied to clipboard
[PHP] Redefinition of variable code in subclass is not allowed. Previously declared at haxe._Exception.NativeException
Hej,
I want to use a custom exception with a code param, but it seems it's yet used in PHP target haxe._Exception.NativeException even if haxe.Exception haven't it in its extern declaration...
So this piece of code compile well on all targets excepts on PHP :
@:native( "MyError" )
class Error extends haxe.Exception{
public var code : Null<Int>;
public function new( ?code : Null<Int>, ?message : String ){
super( message );
this.code = code;
}
}
class Main {
public static function main() {
throw new Error( "Fatal" );
}
}
Thanks for reading me