haxe
haxe copied to clipboard
Null<T> should not satisfy type constraint T
This compiles fine and leads to a null access error:
function getLength<T:String>(v:T) {
return v.length;
}
function main() {
final nullable:Null<String> = null;
trace(getLength(nullable));
}