Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kuanyingchou opened this issue May 23, 2024 · 0 comments · Fixed by #1973
Closed

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

kuanyingchou opened this issue May 23, 2024 · 0 comments · Fixed by #1973
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kuanyingchou
Copy link
Collaborator

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

@neetopia neetopia self-assigned this May 23, 2024
@neetopia neetopia added the bug Something isn't working label May 23, 2024
@neetopia neetopia added this to the 2.1 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants