Add typed Kotlin Java Class types and class literals #85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/kotlin-class-generic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add typed Kotlin Java
Class<T>types and class literalsUnblocks ober/jerboa-android#8 (typed WorkManager worker APIs).
What
(Class T)is now a one-argument compound type in the typed checker andlowers to
java.lang.Class<T>in the Kotlin backend. It composes with theexisting
Out/Inprojections, so(Class (Out ListenableWorker))lowersto
java.lang.Class<out ListenableWorker>— the exact signature AndroidXWorkManager's
PeriodicWorkRequest.Builderaccepts.(kotlin-class ClassName)extern target: takes no arguments and lowersto the compile-checked Kotlin class literal
ClassName::class.java. It isa safe alternative to string-based
Class.forNamelookups for passingtyped worker class tokens to scheduling APIs.
kt-class-literalKAST node withmatching fail-closed validator and printer cases — no raw-source escape.
(Class)stays rejected (bad-type-arity), matching every othercompound type.
Why
The jerboa-mail Android migration needs periodic background inbox sync through
AndroidX WorkManager with typed Jerboa only. The current toolchain fails such
declarations with
unknown-type-constructor/argument-type-mismatchbecause compound
Classtyping and class-literal lowering did not exist.Verification
make buildclean.make test-typed-kotlin— 241 passed, 0 failed (4 new: class-literalprinter units, full-pipeline Class projection, class-literal lowering).
make test-typed-checker— 252 passed, 0 failed (2 new: kotlin-class externaccepts typed use, rejects call arguments).
make test-typed-parser— 58 passed, 0 failed.make test-typed-core— 47 passed, 0 failed.make test-typed-rust— 99 passed, 0 failed.make test-typed-wrappers— 30 passed, 0 failed.make test-typed-kotlin-conformance— 5 passed (compile/run stage skipped:no kotlinc on dev host).
make check-docs— 1356 passed;make data-check— OK.VERSION 0.12.14 -> 0.12.15.