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

TsExprWithTypeArgs should have type_args property instead of type_params #548

Closed
dsherret opened this issue Dec 31, 2019 · 4 comments · Fixed by #549
Closed

TsExprWithTypeArgs should have type_args property instead of type_params #548

dsherret opened this issue Dec 31, 2019 · 4 comments · Fixed by #549
Assignees
Milestone

Comments

@dsherret
Copy link
Contributor

This library is very good at distinguishing type parameters from type arguments (unlike babel), but the declaration for TsExprWithTypeArgs should have a type_args property rather than type_params at it currently does:

#[ast_node("TsExpressionWithTypeArguments")]
pub struct TsExprWithTypeArgs {
    pub span: Span,
    #[serde(rename = "expression")]
    pub expr: TsEntityName,
    #[serde(default)]
    pub type_params: Option<TsTypeParamInstantiation>,
}

This is a breaking change of course... looks like it was done on NewExpr in the past:

#[ast_node("NewExpression")]
pub struct NewExpr {
    pub span: Span,

    pub callee: Box<Expr>,

    #[serde(default, rename = "arguments")]
    pub args: Option<Vec<ExprOrSpread>>,

    #[serde(default, rename = "typeArguments")]
    pub type_args: Option<TsTypeParamInstantiation>,
    // pub type_params: Option<TsTypeParamInstantiation>,
}
@kdy1 kdy1 self-assigned this Dec 31, 2019
@kdy1 kdy1 added this to the v1.1.11 milestone Dec 31, 2019
@kdy1
Copy link
Member

kdy1 commented Dec 31, 2019

Although this is breaking change, I fixed it as it is a correctness issue.

kdy1 added a commit to kdy1/swc that referenced this issue Dec 31, 2019
@dsherret
Copy link
Contributor Author

Awesome! Happy new year, btw!

@kdy1 kdy1 mentioned this issue Dec 31, 2019
@kdy1 kdy1 closed this as completed in #549 Dec 31, 2019
kdy1 added a commit that referenced this issue Dec 31, 2019
swc_ecma_ast:
 - fix TsExprWithTypeArgs (closes #548)

swc_ecma_codegen:
 - allow using default import with namespace import (closes #546)

swc_ecma_parser:
 - parse import.meta (closes #545)
@kdy1
Copy link
Member

kdy1 commented Dec 31, 2019

@dsherret I fixed it. Happy new year!

bors bot pushed a commit that referenced this issue Jan 4, 2020
Just found another occurrence of this. Similar to #548. 

![image](https://user-images.githubusercontent.com/1609021/71735836-716b2d00-2e1d-11ea-8878-50d28da9fa5e.png)

I'm currently going through all the types right now so you might want to hold off on merging this or doing a breaking change release until I finish that.
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 28, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants