From d87e67df58bc2b35ace2e3120f12ffee35ddeaf9 Mon Sep 17 00:00:00 2001 From: Joseph Wunderlich Date: Fri, 22 Feb 2019 18:00:21 -0800 Subject: [PATCH] clarify intent in returnType creation --- src/services/codefixes/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 5f448653a78..45a79613db5 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -156,7 +156,7 @@ namespace ts.codefix { isIdentifier(arg) ? arg.text : isPropertyAccessExpression(arg) ? arg.name.text : undefined); const contextualType = checker.getContextualType(call); - const returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker); + const returnType = (inJs || !contextualType) ? undefined : checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker); return createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,