From 7721cc45c8189d9323ae97549a6bfadfa41d875b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 22 Mar 2018 11:46:52 -0700 Subject: [PATCH] Improve assertion violation message (#22522) --- src/compiler/binder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index db8c390da85..2b66e92cdc3 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -297,7 +297,7 @@ namespace ts { case SyntaxKind.Parameter: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType); + Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType, "Impossible parameter parent kind", () => `parent is: ${(ts as any).SyntaxKind ? (ts as any).SyntaxKind[node.parent.kind] : node.parent.kind}, expected JSDocFunctionType`); const functionType = node.parent; const index = functionType.parameters.indexOf(node as ParameterDeclaration); return "arg" + index as __String;