Closed
Description
TypeScript Version: 2.0.0-beta
Code
Base code:
// A *self-contained* demonstration of the problem follows...
interface Test {
a?: number;
b?: string;
}
interface TestWithStrictProp {
a?: number;
b?: string;
c: string;
}
interface TestIndex {
[key: string]: Test;
}
interface TestIndexWithStrict {
[key: string]: TestWithStrictProp;
}
declare function testFunc<T extends TestIndex>(t: T): void;
declare function testFuncStrict<T extends TestIndexWithStrict>(t: T): void;
Consumer code
testFunc({
test: {
// Compiler doesn't see properties here
}
});
testFuncStrict({
test: {
// Compiler see a?, b? and c
}
});
Expected behavior:
Completion in testFunc({ test: { ... } });