<@U223RM5CH> Well this just works: `val myInt: Int...
# announcements
k
@dragas Well this just works:
val myInt: Int = Integer.valueOf(200)
.
d
What if
Int::class
may be provided via lambda? 🤔
err annotation
k
I don't know, what about it? Can you give an example?
d
Hold on, I'll look into my spaghetti codebase
Copy code
val type = method.getAnnotation(On::class.java).value
builder.testCallback { route, it -> it as Any; type.java.isAssignableFrom(it.javaClass) }
You may provide any class via annotation
@On
Meanwhile it cast to any is necessary as at that particular spot it's a generic.
k
Hmm so your problem is that
isAssignableFrom
doesn't behave correctly?
Maybe file a YouTrack issue?
d
You'll have to use
type.javaObjectType
if you want to always get the boxed class, which is the case here.
So
type.javaObjectType.isAssignableFrom(it.javaClass)
d
Cheers. How would it behave with actual object types? Would it return like
it.java
would?
d
Yes, it would