-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
interface I {
fn: <T>(t: T) => void;
}
interface X {
x: number;
}
function toI<T extends X>() : I {
return {
fn: (t: T) => { // <-- expected a warning from the compiler that the type constraint cannot be enforced
alert(t.x);
}
};
}
function test(i: I): void {
i.fn({}); // <-- problem unnoticed
}
test(toI<X>()); // displays "undefined"
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created