apple / apple/pkl

Implement nested types

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

Description

I'd like to be able to do something like this:

```pkl
class MyA {
properties: Properties

class Properties {
prop1: String
}
}

class MyB {
properties: Properties

class Properties {
prop2: String
}
}

aProps: MyA.Properties
```

Currently, this requires disambiguating classes with only naming, which can lead to very long class names with more deeply nested structures. This code today must look like this:
```pkl
class MyA {
properties: MyAProperties
}

class MyAProperties {
prop1: String
}

class MyB {
properties: MyBProperties
}

class MyBProperties {
prop2: String
}

aProps: MyAProperties
```

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating the compiler areas that parse and resolve class declarations and qualified type references; done means the nested class examples compile and MyA.Properties resolves distinctly from MyB.Properties.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.