Skip to content

Unknown variables should be rejected statically #122

@szeiger

Description

@szeiger

This static verification is required by the Jsonnet specification, but Sjsonnet does not verify references until they are evaluated. Both of these expressions are accepted by Sjsonnet because the illegal references are never evaluated:

$ echo "local x = y; 1" | jsonnet -
STATIC ERROR: <stdin>:1:11: Unknown variable: y

$ echo "local x = self.y; 1" | jsonnet -
STATIC ERROR: <stdin>:1:11-15: Can't use self outside of an object.

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