Closed
Description
openedon Apr 29, 2019
TypeScript Version: 3.4.4
Search Terms:
Code
interface TestType {
a: number;
b: string;
[key:string]: any;
}
type NTestType1 = {
[P in keyof TestType]: any;
}
const test:NTestType1 = {} // error missing a and b. this is correct.
type NTestType2 = {
[P in Exclude<keyof TestType, 'a'>]: any;
}
const test::NTestType2 = {} // no error, we expect show missing b error here.
Expected behavior:
show missing b error
Actual behavior:
no error
Playground Link:
Related Issues:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment