You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the behavior in every version I tried, and I reviewed the FAQ for entries about parsing and generics.
3.33 has a slightly different error message.
Note: when using // @ts-check on a JS file the only error is that the left side of the comma expression is unused (good).
consta=1;constb=2;constc=3;constd=4;(a<b,c>(d));// | | ^ Error: e refers to a value, but is being used as a type here// | ^ Error: c refers to a value, but is being used as a type here// ^ Error: This expression is not callable
🙁 Actual behavior
Errors:
Error: This expression is not callable
Error: c refers to a value, but is being used as a type here
e refers to a value, but is being used as a type here
And the AST contains CallExpression
🙂 Expected behavior
No errors
The AST contains BinaryExpression with LessThanToken etc. instead of CallExpression.
The text was updated successfully, but these errors were encountered:
Bug Report
The last line below evaluates to
true
but is rejected by TS due to< b, c >
being parsed as a type parameter list:Adapted from rust-lang/rfcs#2527 (comment).
Sorry if this issue was known already.
🔎 Search Terms
turbofish
ambiguity
generics
"refers to a value"
🕗 Version & Regression Information
3.5.1 through 4.5.0-beta
This is the behavior in every version I tried, and I reviewed the FAQ for entries about parsing and generics.
3.33 has a slightly different error message.
Note: when using
// @ts-check
on a JS file the only error is that the left side of the comma expression is unused (good).⏯ Playground Link
playground
ts-ast-viewer
💻 Code
🙁 Actual behavior
Errors:
Error: This expression is not callable
Error: c refers to a value, but is being used as a type here
e refers to a value, but is being used as a type here
And the AST contains CallExpression
🙂 Expected behavior
The text was updated successfully, but these errors were encountered: