Hi,
I’m trying to use the haxe lib moon-ai.
I get the error when trying to build for flash “On static platforms, null can’t be used as basic type”.
for this code:
var result:NeuronConnectionInfo =
{
type: null,
connection: null,
};
As you can see, type is an instance of NeuronConnectionType, and NeuronConnectionType is an Int. On statically-typed platforms (like Flash and C++), integers can’t be null.
You have two options here. Either set the default value to 0 (or one of the enum values), or modify NeuronConnectionInfo to allow null values.
private typedef NeuronConnectionInfo =
{
var type:Null<NeuronConnectionType>;
var connection:NeuronConnection;
}