Closed
Description
openedon Jan 11, 2017
TypeScript Version: 2.1.4 - Windows version tsc.cmd
Description: Index signature bug.
var foo: { bar?: 0; [key: string]: any } = {};
foo.newProp = ''; // Error: Property 'newProp' does not exist on type of foo
foo['newProp']= '' // NO error!!! Same code!
How is it possible? 😕
Expected behavior: NO error.
Actual behavior: Error exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment