Add regression test

This commit is contained in:
Anders Hejlsberg
2016-12-04 07:49:55 -08:00
parent c52eb6cef3
commit 95aed3f4ee

View File

@@ -354,4 +354,15 @@ interface Options2<Data, Computed> {
declare class Component2<Data, Computed> {
constructor(options: Options2<Data, Computed>);
get<K extends keyof Data | keyof Computed>(key: K): (Data & Computed)[K];
}
// Repro from #12641
interface R {
p: number;
}
function f<K extends keyof R>(p: K) {
let a: any;
a[p].add; // any
}