mirror of
https://github.com/apple/pkl.git
synced 2026-04-22 08:18:32 +02:00
Fix command typealias unwrapping in resolveType (#1449)
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
```
This commit is contained in:
@@ -407,7 +407,6 @@ public final class CommandSpecParser {
|
||||
} else if (typeNode instanceof TypeNode.TypeAliasTypeNode typeAliasTypeNode) {
|
||||
if (typeAliasTypeNode.getVmTypeAlias() == BaseModule.getCharTypeAlias()) break;
|
||||
typeNode = typeAliasTypeNode.getAliasedTypeNode();
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user