-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TS compiler swallows a syntax error #7602
Comments
But if you wait for few seconds on the page, the right hand output window will show the undesired fixed output which @wycats is referring to. It turned out the output window tend to fix errors in many other cases and it never shows fatal errors. So this is probably not a real bug per se, but certainly an undesired outcome.. |
TS compiler does not guarantee correctness of the emit output if errors were reported. If you don't want to emit anything in presence of errors you can use |
@vladima Syntax errors resulting in a code emit is surprising, though. It's not like you're dealing with type errors, in which the code may still work, or an external API changed, and you're having to migrate types (the types might not check, but the output still works). |
AFAIR initially policy regarding syntax errors was exactly as you've described it. However later we've changed it I think based on user requests, pinging @mhegazy if he remembers more details |
that is correct. previously syntax errors blocked emit, where as semantic errors did not. Users have found that confusing. we switched to a model where errors, regardless of their source, would not block emit, and added a flag, |
http://www.typescriptlang.org/Playground#src=test(%22foo%22%20function()%20%7B%20%7D)%3B
Input:
test("foo" function() { });
Output:
test("foo", function() { });
(it "fixed" the missing comma)Expected: an error of some kind
The text was updated successfully, but these errors were encountered: