Deduplicate incompatible actual descriptors
Otherwise, we might get false positive AMBIGUOUS_ACTUALS due to one and the same descriptor appearing multiple times in a list
This commit is contained in:
+6
-1
@@ -138,7 +138,12 @@ class ExpectedActualDeclarationChecker(
|
||||
}
|
||||
|
||||
// Several compatible actuals on one path: report AMBIGUIOUS_ACTUALS here
|
||||
val atLeastWeaklyCompatibleActuals = compatibility.filterKeys { it.isCompatibleOrWeakCompatible() }.values.flatten()
|
||||
val atLeastWeaklyCompatibleActuals = compatibility
|
||||
.filterKeys { it.isCompatibleOrWeakCompatible() }
|
||||
.values
|
||||
.flatten()
|
||||
.distinct()
|
||||
|
||||
if (atLeastWeaklyCompatibleActuals.size > 1) {
|
||||
trace.report(Errors.AMBIGUOUS_ACTUALS.on(
|
||||
reportOn,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package sample
|
||||
|
||||
expect class <!AMBIGUOUS_ACTUALS("Class 'A'", "middle, middle")!>A<!> {
|
||||
expect class A {
|
||||
fun f()
|
||||
}
|
||||
Reference in New Issue
Block a user