Hey, I already asked this in the coroutines channe...
# reflect
m
Hey, I already asked this in the coroutines channel, but maybe this channel is more appropriate. I have a question regarding suspending function types and reflection, details in 🧵
Consider the following code:
Copy code
@JvmInline
value class DummySuspendValue(val block: suspend () -> Unit)

...

val a = DummySuspendValue {}
val classifier = a::class.declaredMemberProperties.first().returnType.classifier
In the example above, classifier is
null
. According to the docs, `classifier`:
Returns null if this type is not denotable in Kotlin, for example if it is an intersection type.
If I were to go by the reflection behaviour and the docs, I’d have to conclude that a suspending function type is non-denotable. If I remove the suspend modifier like so:
Copy code
@JvmInline
value class DummySuspendValue(val block: () -> Unit)
the classifier is no longer
null
. Is that expected behaviour?
u
Please report an issue at https://kotl.in/issue, this looks like a bug
👍 1
Just in case, I've reported it at KT-79206 Reflection: suspend functional type classifier is null
👍 1