Skip to content

Commit 459df02

Browse files
weswighamDanielRosenwasser
authored andcommitted
Improve assertion violation message (#22522)
1 parent a807336 commit 459df02

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
@@ -301,7 +301,7 @@ namespace ts {
301301
case SyntaxKind.Parameter:
302302
// Parameters with names are handled at the top of this function. Parameters
303303
// without names can only come from JSDocFunctionTypes.
304-
Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType);
304+
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`);
305305
const functionType = <JSDocFunctionType>node.parent;
306306
const index = functionType.parameters.indexOf(node as ParameterDeclaration);
307307
return "arg" + index as __String;

0 commit comments

Comments
 (0)