Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give better error messages for reserved words used as parameter names #17220

Closed
weswigham opened this issue Jul 15, 2017 · 1 comment
Closed
Labels
Domain: Error Messages The issue relates to error messaging Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@weswigham
Copy link
Member

weswigham commented Jul 15, 2017

TypeScript Version: nightly (2.5.0-dev.201xxxxx)

Code

        const candidateImports: string[];
        function addCandidateImport(import: string): void {
            candidateImports = candidateImports || [];
            candidateImports.push(import);
        }

Expected behavior:
Error: Reserved word "import" may not be used as a parameter name. (With a quick fix to give it another name, maybe).

Actual behavior:
Error: Parameter declaration expected. (And then everything after it parses badly)

@mhegazy mhegazy added Domain: Error Messages The issue relates to error messaging Suggestion An idea for TypeScript labels Aug 17, 2017
@RyanCavanaugh RyanCavanaugh added the Experience Enhancement Noncontroversial enhancements label Aug 13, 2018
@RyanCavanaugh RyanCavanaugh added this to the Future milestone Aug 13, 2018
@weswigham weswigham removed the Suggestion An idea for TypeScript label Nov 6, 2018
@RyanCavanaugh RyanCavanaugh added the Suggestion An idea for TypeScript label Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Error Messages The issue relates to error messaging Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants