@@ -11170,7 +11170,7 @@ namespace ts {
11170
11170
checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name);
11171
11171
11172
11172
// Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration
11173
- checkFunctionLikeDeclaration (node);
11173
+ checkFunctionOrMethodDeclaration (node);
11174
11174
11175
11175
// Abstract methods cannot have an implementation.
11176
11176
// Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
@@ -12197,15 +12197,15 @@ namespace ts {
12197
12197
12198
12198
function checkFunctionDeclaration(node: FunctionDeclaration): void {
12199
12199
if (produceDiagnostics) {
12200
- checkFunctionLikeDeclaration (node) || checkGrammarForGenerator(node);
12200
+ checkFunctionOrMethodDeclaration (node) || checkGrammarForGenerator(node);
12201
12201
12202
12202
checkCollisionWithCapturedSuperVariable(node, node.name);
12203
12203
checkCollisionWithCapturedThisVariable(node, node.name);
12204
12204
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
12205
12205
}
12206
12206
}
12207
12207
12208
- function checkFunctionLikeDeclaration (node: FunctionLikeDeclaration ): void {
12208
+ function checkFunctionOrMethodDeclaration (node: FunctionDeclaration | MethodDeclaration ): void {
12209
12209
checkDecorators(node);
12210
12210
checkSignatureDeclaration(node);
12211
12211
const isAsync = isAsyncFunctionLike(node);
@@ -12252,7 +12252,7 @@ namespace ts {
12252
12252
}
12253
12253
12254
12254
checkSourceElement(node.body);
12255
- if (!isAccessor(node.kind) && ! node.asteriskToken) {
12255
+ if (!node.asteriskToken) {
12256
12256
const returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type));
12257
12257
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType);
12258
12258
}
0 commit comments