haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Null<T> should not satisfy type constraint T

Open tobil4sk opened this issue 9 months ago • 4 comments

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));
}

tobil4sk avatar Feb 19 '25 13:02 tobil4sk