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] Property setter parameter name becomes value #1865

Closed
kuanyingchou opened this issue May 2, 2024 · 5 comments · Fixed by #2101
Closed

[KSP2] Property setter parameter name becomes value #1865

kuanyingchou opened this issue May 2, 2024 · 5 comments · Fixed by #2101
Assignees
Labels
bug Something isn't working P2 affects usability but not blocks users
Milestone

Comments

@kuanyingchou
Copy link
Collaborator

In KSP2 the parameter name of property setters is value when the origin is KOTLIN_LIB but is <set-?> when the origin is KOTLIN, while it was always <set-?> in KSP1.

Repro: kuanyingchou@49600e0

@neetopia
Copy link
Contributor

neetopia commented May 6, 2024

does this impact any of your use cases? I think the name itself is not well defined in spec, therefore this is an either way works case, let me know if you have code that directly depends on the name of this setter parameter.

@neetopia neetopia self-assigned this May 6, 2024
@kuanyingchou
Copy link
Collaborator Author

kuanyingchou commented May 7, 2024

Ah, in XProcessing we keep the parameter name user defined and change it to "p0" if we see "<set-?>" as it's not valid in source. With this change this logic doesn't work anymore because we don't know if "value" is user-defined or not. Or is there other ways to tell?

@neetopia
Copy link
Contributor

neetopia commented May 7, 2024

you can check on the origin of the KSValueParameter of the property setter, I got the following output from your repro, does this help?

SYNTHETIC
KOTLIN_LIB

@ting-yuan
Copy link
Collaborator

Per discussion offline, let's

  1. check whether there's anything in the language spec, and
  2. align the naming for source and libs.

@kuanyingchou
Copy link
Collaborator Author

Yes, checking the origin as well as consistent names both work for us. Thanks!

@neetopia neetopia added this to the 2.1 milestone Jun 13, 2024
@neetopia neetopia added bug Something isn't working P2 affects usability but not blocks users labels Jun 13, 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 P2 affects usability but not blocks users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants