diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 898b7b4d539..3949a65eea8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11230,6 +11230,9 @@ namespace ts { } objectLiteral = objectLiteral.parent.parent; } + // There was no contextual ThisType for the containing object literal, so the contextual type + // for 'this' is the type of the object literal itself. + return checkExpressionCached(containingLiteral); } } return undefined;