Currently there's no way to test that a Class value is the class (or a subclass of) a particular class.
open class A
open class B
class C extends A
foo = C is Class<A>
bar = C is Class<B>
Results in:
Even though C is not [a subclass of] B.
Pkl should instead not erase the type parameter:
- Type checks against
Class<T> should check that the value is a Class and that the class is [a subclass of] T
Class<T> type annotations should forbid non-class types for T, including union, nullable, constrained, parameterized, string literal, and nothing types.
See related: apple/pkl-intellij#222
Currently there's no way to test that a
Classvalue is the class (or a subclass of) a particular class.Results in:
Even though
Cis not [a subclass of]B.Pkl should instead not erase the type parameter:
Class<T>should check that the value is aClassand that the class is [a subclass of]TClass<T>type annotations should forbid non-class types forT, including union, nullable, constrained, parameterized, string literal, andnothingtypes.See related: apple/pkl-intellij#222