Correctly type check Class<T> (#1698)

This commit is contained in:
Jen Basch authored and GitHub committed 2026-08-26 05:29:34 +00:00
1 parent a90eb74c2d
commit cb01d6275b
39 files changed
+503 -13

No files matched your search

@@ -59,6 +59,16 @@ Native `pkl` and `pkldoc` binaries for Intel Mac systems are no longer published
To continue running new Pkl releases on these systems, use an appropriate Java runtime and the `jpkl` and `jpkldoc` Java executables.
=== Type check changes for `Class<T>`
In prior versions of Pkl, type arguments to the `Class` type were erased.
Any `Class` value would typecheck against `Class<T>` for any value of `T`.
In Pkl 0.33, this erasure has been removed.
A `Class` value typechecked against `Class<T>` must be a subclass of `T`.
If `T` does not resolve to a class type (i.e. it is a union type, nullable type, string literal type, parameterized type, or `nothing`), the type check will always fail.
=== XXX
== Bug Fixes [small]#🐜#