is there a multiplatform way of doing something like "if this generic parameter type is nullable execute this path of the if" (other than writing a compiler plugin)
✅ 1
a
Amir Hammad
08/18/2024, 7:26 PM
If you inherit from Any it means the type cannot be nullable. Inheriting from Any? Will require the type to be nullable.
🙌 1
b
Bernhard
08/18/2024, 7:28 PM
so, reified generic + is Any? vs is Any
👍 1
c
CLOVIS
08/19/2024, 9:39 AM
It doesn't have to be reified, you just need two overloads, one nullable and one non-nullable, and the compiler will decide which to call