From 81dbf77174422daf1df71d7af46762fbb8763e02 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 21 Feb 2018 11:23:07 -0800 Subject: [PATCH] Debug.failBadSyntaxKind should always be defined and return 'never' --- src/compiler/visitor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts index 9c1462e7ec6a6..8acf068f7be18 100644 --- a/src/compiler/visitor.ts +++ b/src/compiler/visitor.ts @@ -1544,11 +1544,11 @@ namespace ts { export namespace Debug { let isDebugInfoEnabled = false; - export const failBadSyntaxKind = shouldAssert(AssertionLevel.Normal) - ? (node: Node, message?: string): void => fail( + export function failBadSyntaxKind(node: Node, message?: string): never { + return fail( `${message || "Unexpected node."}\r\nNode ${formatSyntaxKind(node.kind)} was unexpected.`, - failBadSyntaxKind) - : noop; + failBadSyntaxKind); + } export const assertEachNode = shouldAssert(AssertionLevel.Normal) ? (nodes: Node[], test: (node: Node) => boolean, message?: string): void => assert(