Skip to content

Commit 5d7856b

Browse files
committed
fix: Correct crash with reflection types
Resolves #1538
1 parent 49c77da commit 5d7856b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/lib/converter/plugins/ImplementsPlugin.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ok } from "assert";
21
import * as ts from "typescript";
32
import {
43
DeclarationReflection,
@@ -233,10 +232,13 @@ export class ImplementsPlugin extends ConverterComponent {
233232
return;
234233
}
235234

236-
ok(
237-
reflection.parent instanceof DeclarationReflection,
238-
"Should be impossible, disallowed by converter."
239-
);
235+
// Need this because we re-use reflections for type literals.
236+
if (
237+
!reflection.parent ||
238+
!reflection.parent.kindOf(ReflectionKind.ClassOrInterface)
239+
) {
240+
return;
241+
}
240242

241243
const symbol = context.project.getSymbolFromReflection(
242244
reflection.parent

0 commit comments

Comments
 (0)