Skip to content

Commit 18e23a1

Browse files
committed
Addressing CR feedback
1 parent 2e5a4ea commit 18e23a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11170,7 +11170,7 @@ namespace ts {
1117011170
checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name);
1117111171

1117211172
// Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration
11173-
checkFunctionLikeDeclaration(node);
11173+
checkFunctionOrMethodDeclaration(node);
1117411174

1117511175
// Abstract methods cannot have an implementation.
1117611176
// Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
@@ -12197,15 +12197,15 @@ namespace ts {
1219712197

1219812198
function checkFunctionDeclaration(node: FunctionDeclaration): void {
1219912199
if (produceDiagnostics) {
12200-
checkFunctionLikeDeclaration(node) || checkGrammarForGenerator(node);
12200+
checkFunctionOrMethodDeclaration(node) || checkGrammarForGenerator(node);
1220112201

1220212202
checkCollisionWithCapturedSuperVariable(node, node.name);
1220312203
checkCollisionWithCapturedThisVariable(node, node.name);
1220412204
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
1220512205
}
1220612206
}
1220712207

12208-
function checkFunctionLikeDeclaration(node: FunctionLikeDeclaration): void {
12208+
function checkFunctionOrMethodDeclaration(node: FunctionDeclaration | MethodDeclaration): void {
1220912209
checkDecorators(node);
1221012210
checkSignatureDeclaration(node);
1221112211
const isAsync = isAsyncFunctionLike(node);
@@ -12252,7 +12252,7 @@ namespace ts {
1225212252
}
1225312253

1225412254
checkSourceElement(node.body);
12255-
if (!isAccessor(node.kind) && !node.asteriskToken) {
12255+
if (!node.asteriskToken) {
1225612256
const returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type));
1225712257
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType);
1225812258
}

0 commit comments

Comments
 (0)