Skip to content

Commit d87e67d

Browse files
committed
clarify intent in returnType creation
1 parent 21ab396 commit d87e67d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/codefixes/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ namespace ts.codefix {
156156
isIdentifier(arg) ? arg.text :
157157
isPropertyAccessExpression(arg) ? arg.name.text : undefined);
158158
const contextualType = checker.getContextualType(call);
159-
const returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker);
159+
const returnType = (inJs || !contextualType) ? undefined : checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker);
160160
return createMethod(
161161
/*decorators*/ undefined,
162162
/*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,

0 commit comments

Comments
 (0)