Add this as a self type (#1708)

This commit is contained in:
Jen Basch
2026-09-02 09:04:15 -07:00
committed by GitHub
parent 1208fa9438
commit 2b697015c7
305 changed files with 1487 additions and 561 deletions
@@ -649,6 +649,12 @@ class KotlinCodeGenerator(
when (this) {
PType.UNKNOWN -> ANY_NULL
PType.NOTHING -> NOTHING
PType.MODULE,
PType.THIS ->
// TODO: support self types: `class Foo<T extends Foo<T>>`
throw KotlinCodeGeneratorException(
"Pkl `${this}` types are not supported by the Kotlin code generator."
)
is PType.StringLiteral -> STRING
is PType.Class -> {
// if in doubt, spell it out