Skip to content

Commit 7721cc4

Browse files
authored
Improve assertion violation message (microsoft#22522)
1 parent 67670d8 commit 7721cc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ namespace ts {
297297
case SyntaxKind.Parameter:
298298
// Parameters with names are handled at the top of this function. Parameters
299299
// without names can only come from JSDocFunctionTypes.
300-
Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType);
300+
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`);
301301
const functionType = <JSDocFunctionType>node.parent;
302302
const index = functionType.parameters.indexOf(node as ParameterDeclaration);
303303
return "arg" + index as __String;

0 commit comments

Comments
 (0)