FIR: handle ambiguity more precisely during constructor processing
This commit is contained in:
+8
-3
@@ -107,8 +107,9 @@ private fun FirScope.getFirstClassifierOrNull(
|
|||||||
|
|
||||||
when {
|
when {
|
||||||
isSuccessCandidate && !isSuccessResult -> {
|
isSuccessCandidate && !isSuccessResult -> {
|
||||||
// any result is better than no result
|
// successful result is better than unsuccessful
|
||||||
isSuccessResult = true
|
isSuccessResult = true
|
||||||
|
isAmbiguousResult = false
|
||||||
result = SymbolWithSubstitutor(symbol, substitutor)
|
result = SymbolWithSubstitutor(symbol, substitutor)
|
||||||
}
|
}
|
||||||
result?.symbol === symbol -> {
|
result?.symbol === symbol -> {
|
||||||
@@ -116,8 +117,12 @@ private fun FirScope.getFirstClassifierOrNull(
|
|||||||
return@processClassifiersByNameWithSubstitution
|
return@processClassifiersByNameWithSubstitution
|
||||||
}
|
}
|
||||||
result != null -> {
|
result != null -> {
|
||||||
// results are similar => ambiguity
|
if (isSuccessResult == isSuccessCandidate) {
|
||||||
isAmbiguousResult = true
|
// results are similar => ambiguity
|
||||||
|
isAmbiguousResult = true
|
||||||
|
} else {
|
||||||
|
// ignore unsuccessful result if we have successful one
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// result == null: any result is better than no result
|
// result == null: any result is better than no result
|
||||||
|
|||||||
Reference in New Issue
Block a user