Automatic semicolon insertion before 'extends' in conditional type

This commit is contained in:
Anders Hejlsberg
2018-02-05 13:56:10 -08:00
parent d584f4d97b
commit 0d3f2166e3
+1 -1
View File
@@ -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 = <ConditionalTypeNode>createNode(SyntaxKind.ConditionalType, type.pos);
node.checkType = type;
// The type following 'extends' is not permitted to be another conditional type