mirror of
https://github.com/apple/pkl.git
synced 2026-09-04 00:47:22 +02:00
Add this as a self type (#1708)
This commit is contained in:
@@ -751,6 +751,12 @@ class JavaCodeGenerator(
|
||||
when (this) {
|
||||
PType.UNKNOWN -> OBJECT.nullableIf(nullable)
|
||||
PType.NOTHING -> TypeName.VOID
|
||||
PType.MODULE,
|
||||
PType.THIS ->
|
||||
// TODO: support self types: `class Foo<T extends Foo<T>>`
|
||||
throw JavaCodeGeneratorException(
|
||||
"Pkl `${this}` types are not supported by the Java code generator."
|
||||
)
|
||||
is PType.StringLiteral -> STRING.nullableIf(nullable)
|
||||
is PType.Class -> {
|
||||
// if in doubt, spell it out
|
||||
|
||||
Reference in New Issue
Block a user