-
Notifications
You must be signed in to change notification settings - Fork 503
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
New RuleId
value class mangled, preventing use in Java
#2041
Comments
A similar issue occurs for the extension properties on |
Currently, we work around name-mangling issues with special Kotlin classes. The root issue is tracked here: pinterest/ktlint#2041 Also fixes the IntelliJ .editorconfig import order property to better match Eclipse formatting
…s. Those classes were defined as value classes in `0.49.0` and `0.49.1`. Although the classes were marked with `@JvmInline` it seems that it is not possible to uses those classes from Java base API Consumers like Spotless. The classes have now been replaced with data classes. Closes #2041
I didn't know about interoperability issues with value classes. After some googling around, I get the feeling that those issues are known for a long time and are not very likely to be fixed:
|
Can you validate with the latest snapshot build whether the problem is solved? Technically, this is a breaking change and I will have to release it as |
@magneticflux- can you elaborate what your use case is for accessing these values from Java? |
Nevermind; heard from Paul that it's for Spotless |
@paul-dingemans Yep, everything seems fine here, thanks for the quick turnaround! I tested in Spotless using this patch: diffplug/spotless#1706 (comment), which I'll use as a base for the full My Spotless PR already supports |
Tnx for confirming that the problem is solved. Also, I am grateful that you mentioned explicitly that for now you have worked around it with reflection. Releasing |
Expected Behavior
I should be able to reference, use, and construct
RuleId
s from Java code.Observed Behavior
I cannot access the third property of
LintError
(aRuleId
). The generated bytecode shows that the name is mangled, per the docs:This can be fixed by explicitly specifying the name with
@JvmName
.Your Environment
0.49.1
The text was updated successfully, but these errors were encountered: