Skip to content

Fix typealias unwrapping in resolveType#1449

Merged
HT154 merged 1 commit intoapple:mainfrom
KushalP:CommandParser-typealias-nullable
Feb 27, 2026
Merged

Fix typealias unwrapping in resolveType#1449
HT154 merged 1 commit intoapple:mainfrom
KushalP:CommandParser-typealias-nullable

Conversation

@KushalP
Copy link
Copy Markdown
Contributor

@KushalP KushalP commented Feb 27, 2026

The loop unwraps nullables and constraints but breaks straight away after a typealias. This means the nullable is missed. Removing the break fixes it.

Exception

org.pkl.core.PklException: –– Pkl Error ––
Command option property `foo` has unsupported type `String?`.

11 | foo: OptionalString
     ^^^^^^^^^^^^^^^^^^^
at <unknown> (file:///var/folders/xh/lmp1n6qj4m13t53cfmbqnkwh0000gn/T/junit-1378070630576324311/cmd.pkl)

Use a supported type or define a transformEach and/or transformAll function

The loop unwraps nullables and constraints but breaks straight away
after a `typealias`. This means the nullable is missed. Removing the
`break` fixes it.

## Exception

```
org.pkl.core.PklException: –– Pkl Error ––
Command option property `foo` has unsupported type `String?`.

11 | foo: OptionalString
     ^^^^^^^^^^^^^^^^^^^
at <unknown> (file:///var/folders/xh/lmp1n6qj4m13t53cfmbqnkwh0000gn/T/junit-1378070630576324311/cmd.pkl)

Use a supported type or define a transformEach and/or transformAll function
```
@HT154 HT154 merged commit f9b880b into apple:main Feb 27, 2026
32 of 33 checks passed
@KushalP KushalP deleted the CommandParser-typealias-nullable branch March 11, 2026 12:30
HT154 pushed a commit that referenced this pull request Mar 25, 2026
The loop unwraps nullables and constraints but breaks straight away
after a `typealias`. This means the nullable is missed. Removing the
`break` fixes it.

## Exception

```
org.pkl.core.PklException: –– Pkl Error ––
Command option property `foo` has unsupported type `String?`.

11 | foo: OptionalString
     ^^^^^^^^^^^^^^^^^^^
at <unknown> (file:///var/folders/xh/lmp1n6qj4m13t53cfmbqnkwh0000gn/T/junit-1378070630576324311/cmd.pkl)

Use a supported type or define a transformEach and/or transformAll function
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants