apple / pkl

A configuration as code language with rich validation and tooling.
https://pkl-lang.org
Apache License 2.0
10.38k stars 280 forks source link

Listing with computed index has wrong length #780

Closed translatenix closed 1 week ago

translatenix commented 2 weeks ago

The following program prints length = 2:

local l1 = new Listing {
  "foo"
}

local l2 = (l1) {
  [0 + 0] = "bar"
}

length = l2.length

If [0 + 0] is replaced with [0], the program prints the expected length = 1.

bioball commented 2 weeks ago

Good catch!