Skip to content

Commit 0922aca

Browse files
committed
After much deliberation and inspection, much simpler fix
1 parent 829944f commit 0922aca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13535,7 +13535,7 @@ namespace ts {
1353513535
// be "pushed" onto a node using the contextualType property.
1353613536
function getApparentTypeOfContextualType(node: Expression, checkMode?: CheckMode): Type {
1353713537
const type = getContextualType(node, checkMode);
13538-
return type && getApparentType(type);
13538+
return type && mapType(type, getApparentType);
1353913539
}
1354013540

1354113541
/**

tests/baselines/reference/contextualTypingOfOptionalMembers.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ declare function foo<T extends Bar>(x: string | T): T;
9090
>T : T
9191

9292
const y = foo({
93-
>y : Bar
94-
>foo({ bar(x) { // Should be typed number => void }}) : Bar
93+
>y : { bar(x: number): void; }
94+
>foo({ bar(x) { // Should be typed number => void }}) : { bar(x: number): void; }
9595
>foo : <T extends Bar>(x: string | T) => T
9696
>{ bar(x) { // Should be typed number => void }} : { bar(x: number): void; }
9797

0 commit comments

Comments
 (0)