Fix infinite loop while searching for nodes in type chain
This commit is contained in:
parent
9f6fe70f38
commit
e2923f63c0
1 changed files with 3 additions and 4 deletions
|
@ -529,11 +529,10 @@ function describeKind(kind: Kind): string {
|
|||
}
|
||||
|
||||
function getFirstNodeInTypeChain(type: Type): Syntax | null {
|
||||
let curr = type.next;
|
||||
while (curr !== type && (curr.kind === TypeKind.Var || curr.node === null)) {
|
||||
curr = curr.next;
|
||||
while (type !== type && (type.kind === TypeKind.Var || type.node === null)) {
|
||||
type = type.next;
|
||||
}
|
||||
return curr.node;
|
||||
return type.node;
|
||||
}
|
||||
|
||||
interface PrintExcerptOptions {
|
||||
|
|
Loading…
Reference in a new issue