-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Function call with type parameter causes "unknown TSTypeCastExpression node" error #12141
Copy link
Copy link
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current behavior
If function call has a type parameter and argument expression has :, the following error occurs:
unknown node of type "TSTypeCastExpression" with constructor "e"
However, if I remove the type parameter, the following syntax error occurs:
Did not expect a type annotation here.
Input Code
func<A>(x: any);Expected behavior
The syntax error should occur regardless of the type parameter.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
babel.config.js
{
"presets": ["@babel/preset-typescript"]
}Environment
System:
OS: Linux 4.4 Ubuntu 16.04.7 LTS (Xenial Xerus)
Binaries:
Node: 10.15.1 - ~/local/lib/node-v10.15.1-linux-x64/bin/node
Yarn: 1.22.4 - ~/local/lib/node-v10.15.1-linux-x64/bin/yarn
npm: 6.9.0 - ~/local/lib/node-v10.15.1-linux-x64/bin/npm
npmPackages:
@babel/cli: ^7.11.6 => 7.11.6
@babel/core: ^7.11.6 => 7.11.6
@babel/polyfill: ^7.11.5 => 7.11.5
@babel/preset-env: ^7.11.5 => 7.11.5
@babel/preset-typescript: ^7.10.4 => 7.10.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue