elect
11/08/2022, 4:07 AMNULL
as a companion object of an inline class using a type parameter?
@JvmInline
value class Ptr<T>(val adr: Adr = 0L) {
companion object {
val NULL: Ptr<*>
get() = Ptr(MemoryUtil.NULL) // Not enough information to infer type variable T
}
}
gildor
11/08/2022, 5:31 AMgildor
11/08/2022, 5:32 AMgildor
11/08/2022, 5:35 AMelect
11/08/2022, 10:28 AMPtr<Byte>
or Ptr<VkInstance>
elect
11/08/2022, 10:36 AMval a: Ptr<Byte> = Ptr.NULL
elect
11/08/2022, 10:37 AMType mismatch.
Required: Ptr<Byte>
Found: Ptr<*>
elect
11/08/2022, 10:38 AMPtr<Byte>.Companion
but it's not possible, no companionelizarov
11/08/2022, 12:24 PMPtr<out T>
, then it’ll work with Nothing.elect
11/08/2022, 2:48 PMout
?gildor
11/08/2022, 3:34 PM