Skip to content

Late-bound values of iteratees within nested for/spread fail to resolve for-generator variables #741

@bioball

Description

@bioball

This code throws:

bar = new {}

foo {
  for (i in List(1)) {
    ...(bar) {
      baz {
        new { i }
      }
    }.baz
  }
}

This also throws (logically the same code):

bar = new {}

foo {
  for (i in List(1)) {
    for (elem in (bar) {
      baz {
        new { i }
      }
    }.baz) {
      elem
    }
  }
}

Throws:

–– Pkl Error ––
Cannot find property `i`.

7 | new { i }
          ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions