[NI] Report warning if candidate was chosen using only @OverloadResolutionByLambdaReturnType
This commit is contained in:
@@ -155,6 +155,7 @@ class KotlinCallResolver(
|
||||
|
||||
if (maximallySpecificCandidates.size > 1) {
|
||||
maximallySpecificCandidates = candidates.toMutableSet().apply { removeAll(candidatesWithAnnotation) }
|
||||
maximallySpecificCandidates.singleOrNull()?.addDiagnostic(CandidateChosenUsingOverloadResolutionByLambdaAnnotation())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -243,3 +243,9 @@ class NotEnoughInformationForLambdaParameter(
|
||||
reporter.onCallArgument(lambdaArgument, this)
|
||||
}
|
||||
}
|
||||
|
||||
class CandidateChosenUsingOverloadResolutionByLambdaAnnotation : KotlinCallDiagnostic(RESOLVED) {
|
||||
override fun report(reporter: DiagnosticReporter) {
|
||||
reporter.onCall(this)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user