Skip to content

[KSP2] KSFunctionDeclaration.asMemberOf does not return correct types #1919

@kuanyingchou

Description

@kuanyingchou

This is a case in XProcessing. Not sure if it's an intended change. With classes like:

interface Usage : Foo<Long, Integer> {
    fun foo(param: Foo<Double, Integer>): Foo<String, Integer>
}
interface Foo<V1, V2: Integer> : Bar<Baz<V1, Number>, V2> {}
interface Bar<U1, U2: Integer> : Baz<U1, U2> {}
interface Baz<T1, T2: Number> {
    fun method1(): T1
    fun method2(): T2
}

And getting the return type of method1.asMemberOf(UsageType) we get U1 in KSP2 but Baz<Long, Number> in KSP1.

Repro: kuanyingchou@e3414b9

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions