diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c13f678261c..c09d36bcd34 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11205,6 +11205,8 @@ namespace ts { seen = c === node; } }); + // We may be here because of some extra junk between overloads that could not be parsed into a valid node. + // In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here. if (subsequentNode && subsequentNode.pos === node.end) { if (subsequentNode.kind === node.kind) { const errorNode: Node = (subsequentNode).name || subsequentNode;