@@ -2238,7 +2238,7 @@ namespace ts {
2238
2238
isIdentifierOrPattern ( ) ||
2239
2239
isModifierKind ( token ( ) ) ||
2240
2240
token ( ) === SyntaxKind . AtToken ||
2241
- isStartOfType ( /*disableLookahead */ true ) ;
2241
+ isStartOfType ( /*inStartOfParameter */ true ) ;
2242
2242
}
2243
2243
2244
2244
function parseParameter ( ) : ParameterDeclaration {
@@ -2699,7 +2699,7 @@ namespace ts {
2699
2699
}
2700
2700
}
2701
2701
2702
- function isStartOfType ( disableLookahead ?: boolean ) : boolean {
2702
+ function isStartOfType ( inStartOfParameter ?: boolean ) : boolean {
2703
2703
switch ( token ( ) ) {
2704
2704
case SyntaxKind . AnyKeyword :
2705
2705
case SyntaxKind . StringKeyword :
@@ -2729,11 +2729,11 @@ namespace ts {
2729
2729
case SyntaxKind . DotDotDotToken :
2730
2730
return true ;
2731
2731
case SyntaxKind . MinusToken :
2732
- return ! disableLookahead && lookAhead ( nextTokenIsNumericLiteral ) ;
2732
+ return ! inStartOfParameter && lookAhead ( nextTokenIsNumericLiteral ) ;
2733
2733
case SyntaxKind . OpenParenToken :
2734
2734
// Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier,
2735
2735
// or something that starts a type. We don't want to consider things like '(1)' a type.
2736
- return ! disableLookahead && lookAhead ( isStartOfParenthesizedOrFunctionType ) ;
2736
+ return ! inStartOfParameter && lookAhead ( isStartOfParenthesizedOrFunctionType ) ;
2737
2737
default :
2738
2738
return isIdentifier ( ) ;
2739
2739
}
0 commit comments