Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Don't leave parameters in function's original scope when call evaluation is complete #1407

@jakebailey

Description

@jakebailey

Part of #1402 masks the fact that when we call a function, we declare parameters inside of the scope of the function (DeclareParametersInScope) before evaluating it, but never "undo" that work. This means that we may leave traces of an old analysis around. This is particularly bad for the builtins module, whose scopes are never cleared.

The way we evaluate functions with parameters should be modified to either:

  • Restore the old parameters or remove the parameters after calling. This will likely need to be locked so two parallel calls to the same function don't cause weirdness.
  • Create a wrapper scope to evaluate the function body in that can be thrown away. This would lack the locking requirement, but many places do casts from IScope to concrete types and would break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions