Skip to content

Commit

Permalink
Fix conversion of object literals with construct signatures
Browse files Browse the repository at this point in the history
Closes #2036
  • Loading branch information
Gerrit0 committed Sep 1, 2022
1 parent e50d7bf commit 02ec72b
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 101 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

### Bug Fixes

- Fixed conversion of object literal types containing construct signatures, #2036.
- Fixed centering of title bar on wide displays, actually this time, #2046.

## v0.23.13 (2022-09-01)
Expand Down
10 changes: 10 additions & 0 deletions src/lib/converter/types.ts
Expand Up @@ -556,6 +556,9 @@ const typeLiteralConverter: TypeConverter<ts.TypeLiteralNode> = {
for (const signature of type.getCallSignatures()) {
createSignature(rc, ReflectionKind.CallSignature, signature);
}
for (const signature of type.getConstructSignatures()) {
createSignature(rc, ReflectionKind.ConstructorSignature, signature);
}

convertIndexSignature(rc, symbol);

Expand Down Expand Up @@ -584,6 +587,13 @@ const typeLiteralConverter: TypeConverter<ts.TypeLiteralNode> = {
signature
);
}
for (const signature of type.getConstructSignatures()) {
createSignature(
context.withScope(reflection),
ReflectionKind.ConstructorSignature,
signature
);
}

convertIndexSignature(context.withScope(reflection), type.symbol);

Expand Down

0 comments on commit 02ec72b

Please sign in to comment.