Typescript: Give better error messages when reserved names are used for binding identifiers

Created on 15 Oct 2016  路  4Comments  路  Source: microsoft/TypeScript

const data = { in: 1 };
const { in } = data; // <-- [ts] ':' expected.
Error Messages Moderate Suggestion help wanted

Most helpful comment

a error saying: This is an ES6 syntax error and it's not possible to create a local binding named in or something similar

All 4 comments

What are you expecting to happen here? This is an ES6 syntax error and it's not possible to create a local binding named in

a error saying: This is an ES6 syntax error and it's not possible to create a local binding named in or something similar

let delete = 10;

Should also get the same sort of treatment here. Not exactly sure what the parsed syntax tree should look like after this (probably should stay the same), but we could at least give a better error message.

144368-untitled5

Was this page helpful?
0 / 5 - 0 ratings