[FIR] Fixes for call conflict resolution
Let ConeCompositeConflictResolver pass the results of the previous resolver to the next one. Otherwise, we get false positive conflicts when a set of candidates can't be fully reduced by one resolver but could be resolved by the subsequent application of multiple ones. This change makes ConeCompositeConflictResolver order-dependent and thus, ConeOverloadConflictResolver must be invoked last, because it must work on a pre-filtered list. Also, let ConeEquivalentCallConflictResolver use FirStandardOverrideChecker instead of compareCallsByUsedArguments because it's stricter. This all fixes a false positive overload resolution ambiguity in common metadata compilation that is caused by stdlib using the new KMP format. Now stdlib metadata is in the classpath, and so declarations from the stdlib are returned from both MetadataSymbolProvider and KlibBasedSymbolProvider. This isn't a problem per se because duplicate candidates are filtered out by ConeEquivalentCallConflictResolver (K1 works analogously), but in the case of top-level functions with generic receivers like Collection<T>.toTypedArray, the check failed because of the direct comparison of receiver types. #KT-60943 Fixed
This commit is contained in:
committed by
Space Team
parent
86ef313233
commit
724d527fd8
+2
-2
@@ -11,8 +11,8 @@ private val validVal = 1
|
||||
private val <!REDECLARATION!>invalidProp0<!> = 1
|
||||
|
||||
// NB invalidFun0 and invalidProp0 are conflicting overloads, since the following is an ambiguity:
|
||||
fun useInvalidFun0() = invalidFun0()
|
||||
fun useInvalidProp0() = invalidProp0
|
||||
fun useInvalidFun0() = <!OVERLOAD_RESOLUTION_AMBIGUITY!>invalidFun0<!>()
|
||||
fun useInvalidProp0() = <!OVERLOAD_RESOLUTION_AMBIGUITY!>invalidProp0<!>
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>private fun invalidFun1()<!> {}
|
||||
<!CONFLICTING_OVERLOADS!>private fun invalidFun1()<!> {}
|
||||
|
||||
Reference in New Issue
Block a user