Invalid "is" operator
The following should fail at compile time :
"" is Int
isoperator should only compile is there is a possibility for it to be true.
That looks like warning territory, mostly because I can imagine scenarios where a macro might generate this kind of expression. By using a warning, we give the user the option to disable it.
To be clear, are you suggesting that we do a unify rhs lhs check for all such cases?
There are some controversies here in the context of abstracts. Consider this:
import haxe.ds.StringMap;
function main() {
var someMap:Map<String, Int>;
trace(someMap is StringMap);
}
Assigning StringMap<?> to Map<String, ?> is generally not permitted (that is, unification fails) because it relies on the expression-level @:from static inline function fromStringMap<V> on Map being inserted via cast_or_unify. This is not something we can do here though because we don't really have an rhs expression that is typed as StringMap.