Skip to content

Commit 0d3f216

Browse files
committed
Automatic semicolon insertion before 'extends' in conditional type
1 parent d584f4d commit 0d3f216

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,7 +2986,7 @@ namespace ts {
29862986
return parseFunctionOrConstructorType(SyntaxKind.ConstructorType);
29872987
}
29882988
const type = parseUnionTypeOrHigher();
2989-
if (!noConditionalTypes && parseOptional(SyntaxKind.ExtendsKeyword)) {
2989+
if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(SyntaxKind.ExtendsKeyword)) {
29902990
const node = <ConditionalTypeNode>createNode(SyntaxKind.ConditionalType, type.pos);
29912991
node.checkType = type;
29922992
// The type following 'extends' is not permitted to be another conditional type

0 commit comments

Comments
 (0)