-
-
Notifications
You must be signed in to change notification settings - Fork 694
Description
Several places in the coroutine branch use Texpr.Builder.default_value to get a default value for a type, the problem with this function is that it often gives default values which aren't correct. There are two main things it gets wrong.
- Many targets have core type abstracts which represent properly sized integer types,
default_valuereturns null for these which is not correct. haxe.Int64gets a default value of null, which is fine for some targets, but not targets which use a native 64 bit int.
The easiest solution would be to add a bunch of cases for all these known target specific types so they get reasonable default values, as well as pulling in some sort of context so we can check the target and return a appropriate Int64 default value.
Maybe a better solution to prevent an ever growing list of types would be some sort of defaultValue metadata, e.g. @:defaultValue(Int64.ofInt(0))? That would require default_value to do typing though.
Alternatively do nothing and have the coroutine branch attempt to deal with it.