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

Grammar checking errors should be reported during binding phases instead of type-checking phase #6107

Open
dbaeumer opened this issue Dec 15, 2015 · 3 comments
Labels
Committed The team has roadmapped this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@dbaeumer
Copy link
Member

From @StrongRef on December 15, 2015 9:32

When declaring an octal literal, an error is shown.
error1

However, if another error is introduced, the error for octal literal usage is omitted.
error2

Another strict rule violation, this time both errors are visible.
error3

I could like into this one, just want to make sure this is an actual error.

Copied from original issue: microsoft/vscode#1318

@dbaeumer
Copy link
Member Author

This is the tsserver. Moving to TS.

@yuit
Copy link
Contributor

yuit commented Dec 19, 2015

@dbaeumer @StrongRef so here is what happen in these situation. Compilers can have error from different states : parsing, binding, type-checking (this include grammar errors), and emitting phases.The compiler will not report grammar error during typ-checking(e.g "Octal Literals are not available when targeting ECMAScript5 and higher") if there are a parsing errors (e.g from doing 1.foo). However, binding error (e.g the one from ...{p:1, p:2}) will be reported regarding less of parsing errors. The main reason of such behavior is to prevent cascading errors effect.

Arguably, it may be the case taht we should move the grammar checking phase from type-checking phase into binding phase. @CyrusNajmabadi can weight-in more.

@yuit yuit added Suggestion An idea for TypeScript and removed Bug A bug in TypeScript labels Dec 19, 2015
@yuit yuit changed the title Octal literal syntax error is not handled for all cases Grammar checking errors should be reported during binding phases instead of type-checking phase Dec 19, 2015
@yuit yuit modified the milestones: TypeScript 2.0, TypeScript 1.8 Dec 19, 2015
@DanielRosenwasser DanielRosenwasser added the In Discussion Not yet reached consensus label Dec 20, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Feb 23, 2016

should be covered by #6802

@mhegazy mhegazy closed this as completed Feb 23, 2016
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Duplicate An existing issue was already created labels Feb 23, 2016
@mhegazy mhegazy reopened this Feb 23, 2016
@mhegazy mhegazy removed this from the TypeScript 2.0 milestone Feb 23, 2016
@mhegazy mhegazy added the VS Code Tracked There is a VS Code equivalent to this issue label Dec 16, 2016
@RyanCavanaugh RyanCavanaugh added Committed The team has roadmapped this issue and removed In Discussion Not yet reached consensus labels Aug 12, 2017
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 2.6 milestone Aug 12, 2017
@mhegazy mhegazy removed this from the TypeScript 2.6 milestone Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committed The team has roadmapped this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

5 participants