[FIR] Split :compiler:fir:resolve module into three different modules

Those modules are:
- :compiler:fir:providers, which contains Fir and Symbol providers,
    scopes, and different utilities used by them
- :compiler:fir:semantics, which contains different abstractions and
    entities which are used in resolution and in checkers
- :compiler:fir:resolve, which contains all stuff related to resolution
    and inference

There are two pros of this change:
1. It may increase gradle build, because it allows to compile :fir:resolve
  and :fir:checkers modules in parallel
2. Logic of working FIR (scopes, providers, DFA logic system, etc) is
  now separated from logic of resolution phases, so for example checkers,
  which are depend on scopes physically will not be able to run resolve
  in any way
This commit is contained in:
Dmitriy Novozhilov
2021-10-14 13:53:40 +03:00
parent 6995ee9334
commit bee44c6e0f
219 changed files with 1836 additions and 1581 deletions
@@ -13,7 +13,8 @@ dependencies {
api(project(":compiler:fir:cones"))
api(project(":compiler:fir:tree"))
api(project(":compiler:fir:resolve"))
api(project(":compiler:fir:providers"))
api(project(":compiler:fir:semantics"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core", rootProject = rootProject) }
}
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.fir.declarations.utils.addDefaultBoundIfNecessary
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
import org.jetbrains.kotlin.fir.resolve.toSymbol
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.firUnsafe
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
import org.jetbrains.kotlin.fir.symbols.ConeClassifierLookupTag
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
@@ -194,7 +193,7 @@ class FirTypeDeserializer(
attributes: ConeAttributes
): ConeClassLikeType {
val result =
when (functionTypeConstructor.toSymbol(moduleData.session)!!.firUnsafe<FirTypeParameterRefsOwner>().typeParameters.size - arguments.size) {
when ((functionTypeConstructor.toSymbol(moduleData.session)?.fir as FirTypeParameterRefsOwner).typeParameters.size - arguments.size) {
0 -> createSuspendFunctionTypeForBasicCase(functionTypeConstructor, arguments, isNullable, attributes)
1 -> {
val arity = arguments.size - 1