From 0d3f2166e32f9e7260d307b49002962fc2245091 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 5 Feb 2018 13:56:10 -0800 Subject: [PATCH] Automatic semicolon insertion before 'extends' in conditional type --- src/compiler/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 5b8504eb6dc..3209f234f85 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2986,7 +2986,7 @@ namespace ts { return parseFunctionOrConstructorType(SyntaxKind.ConstructorType); } const type = parseUnionTypeOrHigher(); - if (!noConditionalTypes && parseOptional(SyntaxKind.ExtendsKeyword)) { + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(SyntaxKind.ExtendsKeyword)) { const node = createNode(SyntaxKind.ConditionalType, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type