Entry of which key is same with an element index
- Dominant language
- Java
- Stars
- 11.5k
- Forks
- 402
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 20
Description
Hi,
As shown example below, entries of which key matches with an element index will be deleted.
```pkl
foo { [0] = 2; 3 }
bar = foo[0]
```
```console
$ ./pkl eval foo.pkl
foo {
3
}
bar = 3
```
On the other hand, entries of which key does not match with an element index will not be deleted.
```pkl
foo { [1] = 2; 3 }
bar = foo[0]
```
```console
$ ./pkl eval foo.pkl
foo {
[1] = 2
3
}
bar = 3
```
Which behavior is wrong?
Contributor guide
Research direction
Start by reproducing both examples with ./pkl eval and compare how entries whose keys match element indexes are handled. Determine which behavior is intended, then correct the inconsistent behavior and verify that both examples produce the expected results.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100