Skip to content

Commit

Permalink
fix: deprecated symbol stripping does not strip out heritage clause w…
Browse files Browse the repository at this point in the history
…ith imported type

When a non-deprecated class or interface inherits a deprecated class or
interface, the `--strip-deprecated` option does not strip out the
heritage clause.

This particularly affects cases where the inherited class or interface
is non-local, i.e., imported from another file.
  • Loading branch information
Niranjan Jayakar committed Apr 9, 2021
1 parent 82c6880 commit 80bdbab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/jsii/lib/transforms/deprecated-remover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ class Transformation {
const symbol = typeChecker.getSymbolAtLocation(
ts.getNameOfDeclaration(node as ts.Declaration) ?? node,
);
return symbol && typeChecker.getFullyQualifiedName(symbol);
const type = symbol && typeChecker.getDeclaredTypeOfSymbol(symbol);
return type?.symbol && typeChecker.getFullyQualifiedName(type.symbol);
}

private static typeReference(
Expand Down

0 comments on commit 80bdbab

Please sign in to comment.