Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 1cee2e3

Browse files
Pajnsoda0289
authored andcommitted
Fix: Nested type arguments are not preserved (fixes #204) (#205)
1 parent 5a324a3 commit 1cee2e3

7 files changed

+473
-6
lines changed

lib/ast-converter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,10 @@ module.exports = function(ast, extra) {
546546
typeArgument.end
547547
],
548548
loc: getLocFor(typeArgumentStart, typeArgument.end, ast),
549-
id: convertChild(typeArgument.typeName || typeArgument)
549+
id: convertChild(typeArgument.typeName || typeArgument),
550+
typeParameters: (typeArgument.typeArguments)
551+
? convertTypeArgumentsToTypeParameters(typeArgument.typeArguments)
552+
: null
550553
};
551554
})
552555
};

tests/fixtures/typescript/basics/class-with-implements-generic-multiple.result.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ module.exports = {
153153
}
154154
},
155155
"name": "S"
156-
}
156+
},
157+
"typeParameters": null
157158
},
158159
{
159160
"type": "GenericTypeAnnotation",
@@ -188,7 +189,8 @@ module.exports = {
188189
}
189190
},
190191
"name": "T"
191-
}
192+
},
193+
"typeParameters": null
192194
}
193195
]
194196
}
@@ -398,4 +400,4 @@ module.exports = {
398400
}
399401
}
400402
]
401-
};
403+
};

tests/fixtures/typescript/basics/class-with-implements-generic.result.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ module.exports = {
153153
}
154154
},
155155
"name": "S"
156-
}
156+
},
157+
"typeParameters": null
157158
}
158159
]
159160
}
@@ -327,4 +328,4 @@ module.exports = {
327328
}
328329
}
329330
]
330-
};
331+
};

0 commit comments

Comments
 (0)