Merge pull request #5235 from Microsoft/fixDecoratorDiagostics

Fix exception in compiler when type checking decorators with generics.
This commit is contained in:
Mohamed Hegazy
2015-10-14 12:29:08 -07:00
4 changed files with 71 additions and 2 deletions

View File

@@ -437,8 +437,12 @@ namespace ts {
}
export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain {
Debug.assert(!headChain.next);
headChain.next = tailChain;
let lastChain = headChain;
while (lastChain.next) {
lastChain = lastChain.next;
}
lastChain.next = tailChain;
return headChain;
}