[FE1.0] Optimize search of expect class member in annotation checker

In the following scenario, when we search corresponding expect member
for actual `A.B`, we can skip checking compatibility of `B` scope.
```
class A {
  class B {
    fun foo() {}
  }
}
actual typealias AImpl = A
```

This is because:

1. Annotation checker runs no matter if found expect class is compatible
or not.
2. Class always has at most one corresponding `expect` class (unlike for
functions, which may have several overrides), so we are sure that we
found the right member.

^KT-60668
^KT-60936
This commit is contained in:
Roman Efremov
2023-08-17 16:16:27 +02:00
committed by Space Team
parent f1ea6545eb
commit b57940a59b
13 changed files with 102 additions and 11 deletions
@@ -517,5 +517,6 @@ internal abstract class IrExpectActualMatchingContext(
expectClass: RegularClassSymbolMarker,
actualClass: RegularClassSymbolMarker,
actualMember: DeclarationSymbolMarker,
checkClassScopesCompatibility: Boolean,
): Map<out DeclarationSymbolMarker, ExpectActualCompatibility<*>> = error("Should not be called")
}