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