-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
area: commentsarea: flowoutdatedA 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
@babel/plugin-transform-flow-comments removes generic type arguments of the right hand side of the extends keyword
class A extends B {}Input Code
REPL link
class A extends B<X> {}Expected behavior/code
class A extends B /*:: <X>*/ {}Environment
- Babel version(s): v7.5.5
- How you are using Babel: Online REPL
Possible Solution
return {
//...
visitor: {
//...
ClassDeclaration(path) {
if (path.parentPath.isFlow()) {
return;
}
const { node } = path;
if (node.superTypeParameters) {
const superTypeParameters = path.get("superTypeParameters");
const superClass = path.get("superClass");
superClass.addComment("trailing", generateComment(superTypeParameters, node));
superTypeParameters.remove();
}
},
//...
},
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: commentsarea: flowoutdatedA 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