@@ -1093,8 +1093,8 @@ namespace ts {
10931093 return currentToken = scanner . reScanTemplateToken ( ) ;
10941094 }
10951095
1096- function reScanLessThanToken ( ) : SyntaxKind {
1097- return currentToken = scanner . reScanLessThanToken ( ) ;
1096+ function reScanLesserToken ( ) : SyntaxKind {
1097+ return currentToken = scanner . reScanLesserToken ( ) ;
10981098 }
10991099
11001100 function scanJsxIdentifier ( ) : SyntaxKind {
@@ -2267,7 +2267,7 @@ namespace ts {
22672267 function parseTypeReference ( ) : TypeReferenceNode {
22682268 const node = < TypeReferenceNode > createNode ( SyntaxKind . TypeReference ) ;
22692269 node . typeName = parseEntityName ( /*allowReservedWords*/ true , Diagnostics . Type_expected ) ;
2270- if ( ! scanner . hasPrecedingLineBreak ( ) && reScanLessThanToken ( ) === SyntaxKind . LessThanToken ) {
2270+ if ( ! scanner . hasPrecedingLineBreak ( ) && reScanLesserToken ( ) === SyntaxKind . LessThanToken ) {
22712271 node . typeArguments = parseBracketedList ( ParsingContext . TypeArguments , parseType , SyntaxKind . LessThanToken , SyntaxKind . GreaterThanToken ) ;
22722272 }
22732273 return finishNode ( node ) ;
@@ -4506,7 +4506,8 @@ namespace ts {
45064506 function parseCallExpressionRest ( expression : LeftHandSideExpression ) : LeftHandSideExpression {
45074507 while ( true ) {
45084508 expression = parseMemberExpressionRest ( expression ) ;
4509- if ( token ( ) === SyntaxKind . LessThanToken ) {
4509+ // handle 'foo<<T>()'
4510+ if ( token ( ) === SyntaxKind . LessThanToken || token ( ) === SyntaxKind . LessThanLessThanToken ) {
45104511 // See if this is the start of a generic invocation. If so, consume it and
45114512 // keep checking for postfix expressions. Otherwise, it's just a '<' that's
45124513 // part of an arithmetic expression. Break out so we consume it higher in the
@@ -4548,9 +4549,10 @@ namespace ts {
45484549 }
45494550
45504551 function parseTypeArgumentsInExpression ( ) {
4551- if ( ! parseOptional ( SyntaxKind . LessThanToken ) ) {
4552+ if ( reScanLesserToken ( ) !== SyntaxKind . LessThanToken ) {
45524553 return undefined ;
45534554 }
4555+ nextToken ( ) ;
45544556
45554557 const typeArguments = parseDelimitedList ( ParsingContext . TypeArguments , parseType ) ;
45564558 if ( ! parseExpected ( SyntaxKind . GreaterThanToken ) ) {
0 commit comments