Skip to content

fix(compiler-cli): do not flag callable objects with zero parameters in uninvoked track function check - #70212

Open
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix-ng8115-fieldtree
Open

fix(compiler-cli): do not flag callable objects with zero parameters in uninvoked track function check#70212
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix-ng8115-fieldtree

Conversation

@JeanMeche

@JeanMeche JeanMeche commented Aug 14, 2026

Copy link
Copy Markdown
Member

In @for blocks, tracking callable objects by reference (such as Signal Forms FieldTree, signals, or custom callable objects) is a valid pattern when tracking by object identity (e.g. @for (row of rows(); track row.field)).

Previously, UninvokedTrackFunctionCheck (NG8115) flagged any property read whose type has call signatures, regardless of whether the target was an actual track function expecting arguments or a method declaration.

This PR updates UninvokedTrackFunctionCheck to only emit a diagnostic when:

  1. The target expression has call signatures that declare parameters (i.e. Functions expecting arguments like (item) or (index, item)).
  2. Or the target expression is a method declaration.

Callable objects without parameters accessed as properties are now recognized as tracked values and not flagged as uninvoked track functions.

Fixes #70207

@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Aug 14, 2026
@ngbot ngbot Bot added this to the Backlog milestone Aug 14, 2026
@JeanMeche
JeanMeche force-pushed the fix-ng8115-fieldtree branch 2 times, most recently from d25e49c to 6e61477 Compare August 14, 2026 22:16
@JeanMeche JeanMeche changed the title fix(compiler-cli): ignore FieldTree references in uninvoked track function check fix(compiler-cli): do not flag callable objects with zero parameters in uninvoked track function check Aug 14, 2026
@JeanMeche
JeanMeche force-pushed the fix-ng8115-fieldtree branch from 6e61477 to 1730819 Compare August 14, 2026 22:25
@JeanMeche
JeanMeche marked this pull request as ready for review August 14, 2026 22:30
@JeanMeche
JeanMeche requested a review from atscott August 14, 2026 22:30
@JeanMeche
JeanMeche force-pushed the fix-ng8115-fieldtree branch from 1730819 to 58b1ed2 Compare August 14, 2026 22:31
…in uninvoked track function check

In `@for` blocks, tracking callable objects by reference (e.g. signal forms `FieldTree`, signals, or custom callable objects) is a valid pattern when tracking by object identity. Previously, `UninvokedTrackFunctionCheck` (NG8115) flagged any property read whose type has call signatures, regardless of whether the target was an actual track function expecting arguments or a method reference.

This commit updates `UninvokedTrackFunctionCheck` to only emit a diagnostic when the target expression has call signatures that declare parameters (functions/methods expecting arguments like `(item)` or `(index, item)`) or is a method declaration. Callable objects without parameters accessed as properties are now recognized as tracked values and not flagged as uninvoked track functions.

Fixes angular#70207
@JeanMeche
JeanMeche force-pushed the fix-ng8115-fieldtree branch from 58b1ed2 to bb55e8d Compare August 14, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NG8115 fires on the documented Signal Forms field-identity tracking when the field is reached through a property

1 participant