diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 95c187b7bc0..be9047326ca 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5952,8 +5952,10 @@ module ts { } function getContextualSignatureForFunctionLikeDeclaration(node: FunctionLikeDeclaration): Signature { - // Only function expressions and arrow functions are contextually typed. - return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; + // Only function expressions, arrow functions, and object literal methods are contextually typed. + return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) + ? getContextualSignature(node) + : undefined; } // Return the contextual signature for a given expression node. A contextual type provides a