-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead
Description
PR #5949 implements F-bounded polymorphism. It doesn't seem to be working correctly for methods.
interface Table<T> {
// For this method `T` is apparently a brand new type parameter.
insert<T extends U, U>(obj: U): T;
// insert(obj: any)
}
interface Foo {
a: string;
b: string;
}
let Foos: Table<Foo>;
// `foo1`'s type is inferred to be {a: 1}
let foo1 = Foos.insert({a: 1}) // => ;
// Should produce error
let foo2 = Foos.insert({c: 1});
Metadata
Metadata
Assignees
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead