-
Notifications
You must be signed in to change notification settings - Fork 289
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
FunSpec.overriding does not handle internal methods correctly #828
Comments
Heavily discussed in #236 |
@Leland-Takamine KotlinPoet does work with Kotlin metadata but through different API, please refer to https://github.com/square/kotlinpoet/blob/master/kotlinpoet-metadata-specs/README.md and https://github.com/square/kotlinpoet/blob/master/kotlinpoet-metadata/README.md. We should probably deprecate existing introspection API since they don't work well with Kotlin. |
+1 on deprecating the existing. It's a straight port from javapoet but is wrong often enough to be untrustworthy |
Folding this into #236 since it's basically a duplicate of the discussion there. |
Repro Steps
Explanation
Method to be overridden
Overriding method generated via
FunSpec.overriding(...)
Notice that the generated method includes the
$repro
suffix. This is due to the fact that Kotlin mangles the names of internal methods.Possible Solution
KotlinPoet should inspect the Kotlin metadata to use the original method name for overriding.
The text was updated successfully, but these errors were encountered: