Skip to content

fix: track unknowns through comprehensions#1341

Open
rohan-patnaik wants to merge 1 commit into
cel-expr:masterfrom
rohan-patnaik:rpatnaik/cel-comprehension-unknown-attrs
Open

fix: track unknowns through comprehensions#1341
rohan-patnaik wants to merge 1 commit into
cel-expr:masterfrom
rohan-patnaik:rpatnaik/cel-comprehension-unknown-attrs

Conversation

@rohan-patnaik

Copy link
Copy Markdown
Contributor

What changed

  • Let comprehensions iterate when only a child of the range is unknown.
  • Mark matching range elements as unknown during iteration.
  • Preserve the original attribute trail, e.g. items[2].field.

Why

Partial evaluation currently stops at the range variable for descendant unknowns. This lets expressions like items.exists(x, x.field == 'test') report the specific unknown child attribute.

Fixes #321.

Testing

  • go test ./interpreter -run 'TestInterpreter_ComprehensionTracksUnknownAttribute|TestInterpreter$'
  • go test ./interpreter

@rohan-patnaik rohan-patnaik marked this pull request as ready for review June 16, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attribute Tracking Through Comprehensions

1 participant