TypeScript Version:
1.8.7
Code
typeOnlyNumberKeys={[key: number]: any};leta: OnlyNumberKeys={};a["abcd"]=1;// No error?letx=a["abcd"];// No error?typeOnlyStringKeys={[key: string]: any};letb: OnlyStringKeys={};b[1234]=1;// No error?lety=b[1234];// No error?Expected behavior:
Should error
Actual behavior:
Doesn't error
(Sorry if this is a duplicate but a search did not yield anything on this)
TypeScript Version:
1.8.7
Code
Expected behavior:
Should error
Actual behavior:
Doesn't error
(Sorry if this is a duplicate but a search did not yield anything on this)