Closed nanjizal closed 5 years ago
Wrong repo?
Simn I was not sure if it should become a evolution. I can add issue on haxe if you prefer.
I have no idea what this is. If you want to achieve anything here then please minimize your example and formulate what you actually think should change.
It errors only on the second line it shows that properties can already accept constraints.
If I understand this correctly, the basic idea is "allow type parameters on properties".
I wrongly assumed that because properties are icing that I could constrain them.
Now it was argued that this was not possible but it's clear that the compiler can properly check constraints if you cheat.
Now the argument can be made that because I am using Dynamic types are not checked but if I try set p0.prop = 'fred' then the compiler complains so it is fully typechecked, just I am by passing a check on the actual property. So it must be feasible to support this currently. Obviously also there is the question of different return types so perhaps it's not desired but likely throws up some edge case that are not currently tied down? I would be inclined to continue to use Dynamic for this case but suspect the loop hole will be removed in future.