@@ -1362,7 +1362,6 @@ export type HasIllegalModifiers =
1362
1362
| PropertyAssignment
1363
1363
| ShorthandPropertyAssignment
1364
1364
| MissingDeclaration
1365
- | FunctionTypeNode
1366
1365
| NamespaceExportDeclaration
1367
1366
;
1368
1367
@@ -1801,7 +1800,7 @@ export interface TypeParameterDeclaration extends NamedDeclaration, JSDocContain
1801
1800
readonly constraint ?: TypeNode ;
1802
1801
readonly default ?: TypeNode ;
1803
1802
1804
- // For error recovery purposes.
1803
+ // For error recovery purposes (see `isGrammarError` in utilities.ts) .
1805
1804
expression ?: Expression ;
1806
1805
}
1807
1806
@@ -1888,7 +1887,7 @@ export interface PropertySignature extends TypeElement, JSDocContainer {
1888
1887
readonly questionToken ?: QuestionToken ; // Present on optional property
1889
1888
readonly type ?: TypeNode ; // Optional type annotation
1890
1889
1891
- // The following properties are used only to report grammar errors
1890
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
1892
1891
/** @internal */ readonly initializer ?: Expression | undefined ; // A property signature cannot have an initializer
1893
1892
}
1894
1893
@@ -1897,7 +1896,7 @@ export interface PropertyDeclaration extends ClassElement, JSDocContainer {
1897
1896
readonly parent : ClassLikeDeclaration ;
1898
1897
readonly modifiers ?: NodeArray < ModifierLike > ;
1899
1898
readonly name : PropertyName ;
1900
- readonly questionToken ?: QuestionToken ; // Present for use with reporting a grammar error
1899
+ readonly questionToken ?: QuestionToken ; // Present for use with reporting a grammar error for auto-accessors (see `isGrammarError` in utilities.ts)
1901
1900
readonly exclamationToken ?: ExclamationToken ;
1902
1901
readonly type ?: TypeNode ;
1903
1902
readonly initializer ?: Expression ; // Optional initializer
@@ -1960,7 +1959,7 @@ export interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer
1960
1959
readonly name : PropertyName ;
1961
1960
readonly initializer : Expression ;
1962
1961
1963
- // The following properties are used only to report grammar errors
1962
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
1964
1963
/** @internal */ readonly modifiers ?: NodeArray < ModifierLike > | undefined ; // property assignment cannot have decorators or modifiers
1965
1964
/** @internal */ readonly questionToken ?: QuestionToken | undefined ; // property assignment cannot have a question token
1966
1965
/** @internal */ readonly exclamationToken ?: ExclamationToken | undefined ; // property assignment cannot have an exclamation token
@@ -1971,11 +1970,11 @@ export interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDoc
1971
1970
readonly parent : ObjectLiteralExpression ;
1972
1971
readonly name : Identifier ;
1973
1972
// used when ObjectLiteralExpression is used in ObjectAssignmentPattern
1974
- // it is a grammar error to appear in actual object initializer:
1973
+ // it is a grammar error to appear in actual object initializer (see `isGrammarError` in utilities.ts) :
1975
1974
readonly equalsToken ?: EqualsToken ;
1976
1975
readonly objectAssignmentInitializer ?: Expression ;
1977
1976
1978
- // The following properties are used only to report grammar errors
1977
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
1979
1978
/** @internal */ readonly modifiers ?: NodeArray < ModifierLike > | undefined ; // shorthand property assignment cannot have decorators or modifiers
1980
1979
/** @internal */ readonly questionToken ?: QuestionToken | undefined ; // shorthand property assignment cannot have a question token
1981
1980
/** @internal */ readonly exclamationToken ?: ExclamationToken | undefined ; // shorthand property assignment cannot have an exclamation token
@@ -2076,7 +2075,7 @@ export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassEle
2076
2075
readonly name : PropertyName ;
2077
2076
readonly body ?: FunctionBody | undefined ;
2078
2077
2079
- // The following properties are used only to report grammar errors
2078
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
2080
2079
/** @internal */ readonly exclamationToken ?: ExclamationToken | undefined ; // A method cannot have an exclamation token
2081
2080
}
2082
2081
@@ -2086,7 +2085,7 @@ export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, Cla
2086
2085
readonly modifiers ?: NodeArray < ModifierLike > | undefined ;
2087
2086
readonly body ?: FunctionBody | undefined ;
2088
2087
2089
- // The following properties are used only to report grammar errors
2088
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
2090
2089
/** @internal */ readonly typeParameters ?: NodeArray < TypeParameterDeclaration > ; // A constructor cannot have type parameters
2091
2090
/** @internal */ readonly type ?: TypeNode ; // A constructor cannot have a return type annotation
2092
2091
}
@@ -2106,7 +2105,7 @@ export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, Cla
2106
2105
readonly name : PropertyName ;
2107
2106
readonly body ?: FunctionBody ;
2108
2107
2109
- // The following properties are used only to report grammar errors
2108
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
2110
2109
/** @internal */ readonly typeParameters ?: NodeArray < TypeParameterDeclaration > | undefined ; // A get accessor cannot have type parameters
2111
2110
}
2112
2111
@@ -2119,7 +2118,7 @@ export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, Cla
2119
2118
readonly name : PropertyName ;
2120
2119
readonly body ?: FunctionBody ;
2121
2120
2122
- // The following properties are used only to report grammar errors
2121
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
2123
2122
/** @internal */ readonly typeParameters ?: NodeArray < TypeParameterDeclaration > | undefined ; // A set accessor cannot have type parameters
2124
2123
/** @internal */ readonly type ?: TypeNode | undefined ; // A set accessor cannot have a return type
2125
2124
}
@@ -2141,7 +2140,7 @@ export interface ClassStaticBlockDeclaration extends ClassElement, JSDocContaine
2141
2140
/** @internal */ endFlowNode ?: FlowNode ;
2142
2141
/** @internal */ returnFlowNode ?: FlowNode ;
2143
2142
2144
- // The following properties are used only to report grammar errors
2143
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
2145
2144
/** @internal */ readonly modifiers ?: NodeArray < ModifierLike > | undefined ;
2146
2145
}
2147
2146
@@ -2190,8 +2189,8 @@ export interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDe
2190
2189
export interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase , LocalsContainer {
2191
2190
readonly kind : SyntaxKind . FunctionType ;
2192
2191
2193
- // The following properties are used only to report grammar errors
2194
- /** @internal */ readonly modifiers ?: NodeArray < Modifier > | undefined ;
2192
+ // A function type cannot have modifiers
2193
+ /** @internal */ readonly modifiers ?: undefined ;
2195
2194
}
2196
2195
2197
2196
export interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase , LocalsContainer {
@@ -3723,7 +3722,7 @@ export interface NamespaceExportDeclaration extends DeclarationStatement, JSDocC
3723
3722
readonly kind : SyntaxKind . NamespaceExportDeclaration ;
3724
3723
readonly name : Identifier ;
3725
3724
3726
- // The following properties are used only to report grammar errors
3725
+ // The following properties are used only to report grammar errors (see `isGrammarError` in utilities.ts)
3727
3726
/** @internal */ readonly modifiers ?: NodeArray < ModifierLike > | undefined ;
3728
3727
}
3729
3728
0 commit comments