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] getJavaWildcard does not return wildcard for List param (different with kapt/ksp1) #2264

Closed
acejingbo opened this issue Dec 23, 2024 · 1 comment · Fixed by #2304
Closed
Milestone

Comments

@acejingbo
Copy link

acejingbo commented Dec 23, 2024

For a method, if it have List<Foo> param,

  • in ksp1, getJavaWildcard will make it List<out Foo>
  • in ksp2, getJavaWildcard will make it List<Foo>.

This has caused lots of difference in codegen, which then cause errors like did not override, etc.

Repro

  • Patch acejingbo@1080402. In this commit, I
    • copied the existing test class in javaWildcard2 but without the @JvmSupressWildcard on class level.
    • copied the ksp1 output to ksp1 test expected result.
    • copied the ksp1 output to ksp2 test expected result, and reordered to match ksp2
  • Run :compiler-plugin:test: See succeed.
  • Run :kotlin-analysis-api:test: See failure. Meaning expected (ksp1 output) have difference with actual (ksp2 output)

Specifically, you can see things like numberList : List<Number> output numberList : List<out Number> in ksp1 but output numberList : List<Number> in ksp2

@acejingbo
Copy link
Author

Personal guesses:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants