Hey another week - another question. So please hav...
# ksp
m
Hey another week - another question. So please have a look at the thread.
I am working currently with inheritance and KSP. For example:
Copy code
@MyAwesomeAnnotation(SuperTyped::class)
interface SuperTyped<K, L> : Parent<K, L> where L : Any, L : Comparable<L>, K : Any

interface Parent<K, L> where L : Any, L : Comparable<L>, K : Any {
    fun <T> lol(vararg x: T)
}
(Please do not mind if the boundaries of Parent are not semantically correct)
However when I work with the KSValueParameter of
lol
I stumbled over that the element of KSType of
T
is resolved to
COVARIANT T
.
While if you resolve the inheritance of code snippet from above like this:
Copy code
@MyAwesomeAnnotation(SuperTyped::class)
interface SuperTyped<K, L> where L : Any, L : Comparable<L>, K : Any {
    fun <T> ppt(vararg x: T)
}
There is actually no element present.
My question is - Is this intentional?
Also it seems to apply only to vararg parameter.
j
there is an issue with
vararg
in inherited code: https://github.com/google/ksp/issues/958 . Not sure if these two cases are same, can you provide a reproduce like the one in the linked issue?
m
Sure first thing tomorrow - do you want a repo or only the code snipes I already posted here?
j
the code snippet along with the KSP snippet you used to get the wrong result should be enough, just like the linked issue.
👍 1