Hello! ```class A<T>( val klass: KClass&lt...
# compiler
p
Hello!
Copy code
class A<T>(
  val klass: KClass<T> // compilation error if T is not T : Any. But I can't make it T : Any, cause see test function declaration below
) {

  fun test(a: T) {
    if (a == null) {
      println("Value is null")
    } else {
      // use a::class 
    }	
  }

}
How to tell compiler that KClass must use T!! while in function test T's nullable must depends on actual T's nullability?
d
Copy code
class X<T>(val klass: KClass<T & Any>)
Actually this question is more suitable for #getting-started This channel is intended for discussion of compiler internals and compiler plugins at the first place
p
Thanks for quick answer! Got it! Next question of such kind will be there.