[IR] Fix annotation arguments comparison when expression is expect enum
...actualized via typealias. This caused false-positive report of `ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE`. In such case it's incorrect to compare signatures, because classes have different `ClassId`s. Instead, classes could be compared using `areCompatibleExpectActualTypes` which actualizes both types, and then enum value names compared. ^KT-62104 ^KT-59940
This commit is contained in:
committed by
Space Team
parent
67a46eba9c
commit
faae5f9b38
+2
-1
@@ -28,7 +28,8 @@ internal fun IrExpectActualMatchingContext.areIrExpressionConstValuesEqual(
|
||||
getClassIdAfterActualization(classId)
|
||||
}
|
||||
|
||||
a is IrGetEnumValue && b is IrGetEnumValue -> equalBy(a, b) { it.symbol.signature?.toString() }
|
||||
a is IrGetEnumValue && b is IrGetEnumValue ->
|
||||
areCompatibleExpectActualTypes(a.type, b.type) && equalBy(a, b) { it.symbol.owner.name }
|
||||
|
||||
a is IrVararg && b is IrVararg -> {
|
||||
collectionArgumentsCompatibilityCheckStrategy.areCompatible(a.elements, b.elements) { f, s ->
|
||||
|
||||
Reference in New Issue
Block a user