-
Notifications
You must be signed in to change notification settings - Fork 279
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
The get / set index access operator overloads are incorrectly escaped #1869
Comments
Looking at the KOperator enum, it looks like it doesn't have any representation for the index access operator forcing it to be null in MemberName thereby bypassing the check in emit and incorrectly escaping the member name |
Thanks! We can probably check if the function name fully matches one of the names in
I believe this is because for all the operators included in |
Describe the bug
Using KotlinPoet 1.16.0 to generate the index-access operator overloads for get / set escapes the function name producing:
instead of:
To Reproduce
This code generates a half-baked collection to reproduce the issue:
produces:
Notice the function name.
Expected behavior
I would expect the function name not to be escaped when overloading the index access operator.
Additional context
This was probably introduced by:
#994
Skimming through the code, it's interesting that MemberName.emit tries to account for this scenario by only escaping the name when the operator is null. I wonder if we can remove the get / set soft-keywords from Util.KEYWORDS or if that would introduce any other side-effects.
The text was updated successfully, but these errors were encountered: