File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11601,7 +11601,7 @@ namespace ts {
1160111601 }
1160211602 }
1160311603 }
11604- if (compilerOptions. noImplicitThis) {
11604+ if (noImplicitThis) {
1160511605 const containingLiteral = getContainingObjectLiteral(func);
1160611606 if (containingLiteral) {
1160711607 // We have an object literal method. Check if the containing object literal has a contextual type
@@ -11622,9 +11622,9 @@ namespace ts {
1162211622 type = getApparentTypeOfContextualType(literal);
1162311623 }
1162411624 // There was no contextual ThisType<T> for the containing object literal, so the contextual type
11625- // for 'this' is the contextual type for the containing object literal or the type of the object
11626- // literal itself.
11627- return contextualType || checkExpressionCached(containingLiteral);
11625+ // for 'this' is the non-null form of the contextual type for the containing object literal or
11626+ // the type of the object literal itself.
11627+ return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral);
1162811628 }
1162911629 // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the
1163011630 // contextual type for 'this' is 'obj'.
You can’t perform that action at this time.
0 commit comments