Skip to content

Commit

Permalink
Fix private parameter properties
Browse files Browse the repository at this point in the history
Resolves #2064
  • Loading branch information
Gerrit0 committed Oct 2, 2022
1 parent 97de3e3 commit 0312504
Show file tree
Hide file tree
Showing 6 changed files with 653 additions and 591 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Unreleased

### Bug Fixes

- Private parameter properties will no longer be ignored, #2064.

## v0.23.15 (2022-09-18)

### Features
Expand Down
17 changes: 12 additions & 5 deletions src/lib/converter/symbols.ts
Expand Up @@ -966,12 +966,19 @@ function isInherited(context: Context, symbol: ts.Symbol) {
parentSymbol,
`No parent symbol found for ${symbol.name} in ${context.scope.name}`
);

const parents = parentSymbol.declarations?.slice() || [];
const constructorDecls = parents.flatMap((parent) =>
ts.isClassDeclaration(parent)
? parent.members.filter(ts.isConstructorDeclaration)
: []
);
parents.push(...constructorDecls);

return (
parentSymbol
.getDeclarations()
?.some((d) =>
symbol.getDeclarations()?.some((d2) => d2.parent === d)
) === false
parents.some((d) =>
symbol.getDeclarations()?.some((d2) => d2.parent === d)
) === false
);
}

Expand Down

0 comments on commit 0312504

Please sign in to comment.