[FIR] Fix case with lazy resolve in expect-actual annotation checker
Unresolved annotation arguments were treated as absent arguments, which lead to false-positive reports. Add assert and test for that and fix. MR: KT-MR-12245 ^KT-60671 Fixed
This commit is contained in:
committed by
Space Team
parent
4c75fb108f
commit
0fd700de21
+4
-1
@@ -232,7 +232,10 @@ object AbstractExpectActualAnnotationMatchChecker {
|
||||
|
||||
var firstIncompatibility: Incompatibility? = null
|
||||
|
||||
checkAnnotationsOnTypeRefAndArguments(expectTypeRef, actualTypeRef) { expectAnnotations, actualAnnotations, actualTypeRefSource ->
|
||||
checkAnnotationsOnTypeRefAndArguments(
|
||||
expectDeclarationSymbol, actualDeclarationSymbol,
|
||||
expectTypeRef, actualTypeRef
|
||||
) { expectAnnotations, actualAnnotations, actualTypeRefSource ->
|
||||
if (firstIncompatibility == null) {
|
||||
firstIncompatibility = areAnnotationListsCompatible(expectAnnotations, actualAnnotations, actualDeclarationSymbol)
|
||||
?.let { Incompatibility(expectDeclarationSymbol, actualDeclarationSymbol, actualTypeRefSource, type = it) }
|
||||
|
||||
+5
-1
@@ -248,6 +248,10 @@ interface ExpectActualMatchingContext<T : DeclarationSymbolMarker> : TypeSystemC
|
||||
* **Example**: for type `@Ann1 List<@Ann2 Map<@Ann3 Int, @Ann4 String>>`, there are 4 types to check in [checker].
|
||||
*/
|
||||
fun checkAnnotationsOnTypeRefAndArguments(
|
||||
expectTypeRef: TypeRefMarker, actualTypeRef: TypeRefMarker, checker: AnnotationsCheckerCallback,
|
||||
expectContainingSymbol: DeclarationSymbolMarker,
|
||||
actualContainingSymbol: DeclarationSymbolMarker,
|
||||
expectTypeRef: TypeRefMarker,
|
||||
actualTypeRef: TypeRefMarker,
|
||||
checker: AnnotationsCheckerCallback,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user