Skip to content

partial eval: comprehensions not plugged after partial eval #656

Closed
@tsandall

Description

If a comprehension closes over local variables, they remain in the saved comprehension after being returned to the caller. As a result, when the caller receives a safety error when they try to compile the comprehension.

Example:

package test

p {
  x = 1
  [true | x]  # close over local var 'x'
}

Partially evaluating the query data.test.p results in:

[true | x] = _; neq(_, false); _ = true

Where x is unsafe.

The query evaluator should plug the comprehension before returning it to callers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions