How do I check if a member is of a nullable class
# reflect
s
How do I check if a member is of a nullable class
s
you seem to have missed the code I posted. I can't use
isMarkedNullable
because I have to check the class type.
Though I figured it out. You have to use
.starProjectedType
and then
withNullability(true)
d
I did not miss your code.
it.returnType
is of type
KType
. Just call
isMarkedNullable
on that.
s
isMarkedNullable returns Boolean, not the KType. I cannot compare the type then.
d
it.isMarkedNullabe && it.classifier == YourClass::class
checks for
YourClass?
.