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
UnusedPrivateMember - [invoke]: False positive: Used by public member function #4435
Comments
Related with #4242. |
@hfhbd your issue I think that it will be solved by #4441 because you aren't using type solving. But I'll keep this open because we have the same issue with type solving too. I reproduced that issue with this test: it("does not report used invoke operator - #4435") {
val code = """
object Test {
private operator fun invoke(i: Int): Int = i
fun answer() = Test(1)
}
val answer = Test.answer()
"""
assertThat(subject.compileAndLintWithContext(env, code)).isEmpty()
} |
This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
@BraisGabin Is the stance that we should acknowledge such degradation of |
Hi @BraisGabin, this is also blocked for my project. I have created a PR for the fix at #5717 |
Expected Behavior
no issue
Observed Behavior
UnusedPrivateMember - [invoke] at /Users/philipwedemann/invokeFalsePositive/src/main/kotlin/Test.kt:2:5
Steps to Reproduce
./gradlew detekt
See also the attached reproducer project
Context
I adopt the code style from kotlinx.coroutines, which uses this constructor like function to emulate a constructor for an interface:
Using this code style for the
invoke
function and combine it withobject
s results into some kind of namespaces.Your Environment
--scan
option when running the gradle task): https://scans.gradle.com/s/rhwzv6cdovkweinvokeFalsePositive.zip
The text was updated successfully, but these errors were encountered: