apple / apple/pkl

`outer.outer.p` doesn't work?

Open
#158 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

What if I need to access a field `p` which is two levels up? Seems like `outer.outer.p` should access it, but I am getting an error.

```
p = "value one"

d1 {
p = "value two"
w = outer.p // OK
d2 {
x = p // OK
y = module.p // OK
z = outer.outer.p // Results in an error, but shouldn't this resolve to p which is "value one"?
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the nested d1/d2 example from the issue and trace how `outer` references are resolved. Investigate the name-resolution or scope-handling entry point, then verify that `outer.outer.p` resolves to the top-level `p` while the existing `outer.p`, `module.p`, and local lookups continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.