-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
TypeScript Version: [email protected]
Search Terms:
optional chaining receiver call parentheses
Code
const foo = { bar() { return this } };
console.assert(foo === (foo?.bar)());
Expected behavior:
foo
should be propagated as the receiver to the foo.bar
method call.
Actual behavior:
No receiver is propagated (due to the ternary breaking the receiver).
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone