The default upper bound (if none specified) is
Any?(Source)
In other words, when you use T, Kotlin assumes that this might be any type, be it primitive, object or a nullable reference.
To fix this add an upper type:
class Test<T: Any> { ... }
The default upper bound (if none specified) is
Any?(Source)
In other words, when you use T, Kotlin assumes that this might be any type, be it primitive, object or a nullable reference.
To fix this add an upper type:
class Test<T: Any> { ... }