Skip to content

Inlining optimizer erroneously replaces iteration variable within a comprehension #1272

@l46kok

Description

@l46kok

Describe the bug
list.exists(inline_var, inline_var == 1)

Here, inline_var is a shadowed variable which should not be a candidate for inlining.

Expected behavior
inline_var should not be replaced

Additional context
This logic should be ported over: https://github.com/google/cel-java/blob/5039bf9626a91905603d57fdb403c83007548236/optimizer/src/main/java/dev/cel/optimizer/optimizers/InliningOptimizer.java#L136-L153

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions