File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3601,13 +3601,14 @@ namespace ts {
3601
3601
createTypeNode : ( types : NodeArray < TypeNode > ) => UnionOrIntersectionTypeNode
3602
3602
) : TypeNode {
3603
3603
const pos = getNodePos ( ) ;
3604
+ const isUnionType = operator === SyntaxKind . BarToken ;
3604
3605
const hasLeadingOperator = parseOptional ( operator ) ;
3605
- let type = hasLeadingOperator && parseFunctionOrConstructorTypeToError ( operator === SyntaxKind . BarToken )
3606
+ let type = hasLeadingOperator && parseFunctionOrConstructorTypeToError ( isUnionType )
3606
3607
|| parseConstituentType ( ) ;
3607
3608
if ( token ( ) === operator || hasLeadingOperator ) {
3608
3609
const types = [ type ] ;
3609
3610
while ( parseOptional ( operator ) ) {
3610
- types . push ( parseFunctionOrConstructorTypeToError ( operator === SyntaxKind . BarToken ) || parseConstituentType ( ) ) ;
3611
+ types . push ( parseFunctionOrConstructorTypeToError ( isUnionType ) || parseConstituentType ( ) ) ;
3611
3612
}
3612
3613
type = finishNode ( createTypeNode ( createNodeArray ( types , pos ) ) , pos ) ;
3613
3614
}
You can’t perform that action at this time.
0 commit comments