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

Closed
opened 2025-12-30 01:22:31 +01:00 by adam · 0 comments
Owner

Originally created by @bioball on GitHub (Oct 25, 2024).

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 }
          ^
Originally created by @bioball on GitHub (Oct 25, 2024). This code throws: ```pkl bar = new {} foo { for (i in List(1)) { ...(bar) { baz { new { i } } }.baz } } ``` This also throws (logically the same code): ```pkl 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 } ^ ```
adam added the bug label 2025-12-30 01:22:31 +01:00
adam closed this issue 2025-12-30 01:22:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#230