Skip to content

Commit

Permalink
fix: Correct crash with reflection types
Browse files Browse the repository at this point in the history
Resolves #1538
  • Loading branch information
Gerrit0 committed Mar 14, 2021
1 parent 49c77da commit 5d7856b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/converter/plugins/ImplementsPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ok } from "assert";
import * as ts from "typescript";
import {
DeclarationReflection,
Expand Down Expand Up @@ -233,10 +232,13 @@ export class ImplementsPlugin extends ConverterComponent {
return;
}

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

const symbol = context.project.getSymbolFromReflection(
reflection.parent
Expand Down

0 comments on commit 5d7856b

Please sign in to comment.