Skip to content

fix(compiler): use regular optional chaining expression for safe function calls in TCBs#69621

Open
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:tcb-method-call
Open

fix(compiler): use regular optional chaining expression for safe function calls in TCBs#69621
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:tcb-method-call

Conversation

@JeanMeche

Copy link
Copy Markdown
Member

Should not report non-nullable optional chaning on function calls.

fixes #69609

@JeanMeche JeanMeche marked this pull request as ready for review July 2, 2026 12:41
@JeanMeche JeanMeche marked this pull request as draft July 2, 2026 12:53
@JeanMeche JeanMeche requested review from JoostK and crisbeto July 2, 2026 12:58
appFile.moveCursorToText('something?.va¦lue()');
const info = appFile.getQuickInfoAtPosition()!;
expect(toText(info.displayParts)).toEqual('(property) value: Signal<number>');
expect(toText(info.displayParts)).toEqual('(property) value: () => number');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the TSLS reports.

@JoostK JoostK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming this survives a TGP

…tion calls in TCBs

Optional return types should not report non-nullable optional chaning on function calls.

fixes angular#69609
@JeanMeche JeanMeche marked this pull request as ready for review July 3, 2026 10:56
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Jul 3, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 3, 2026
@JeanMeche JeanMeche changed the title fix(compiler): fix(compiler): use regular optional chaining expression for safe function calls in TCBs Jul 3, 2026
@JeanMeche JeanMeche removed the request for review from crisbeto July 3, 2026 11:02
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular flags valid null check as NG8107 for function calls

2 participants