FIR: do not run full tower resolve on integer literal type
This commit is contained in:
@@ -137,7 +137,8 @@ class FirCallResolver(
|
||||
val result = towerResolver.runResolver(
|
||||
consumer,
|
||||
implicitReceiverStack.receiversAsReversed(),
|
||||
shouldProcessExtensionsBeforeMembers = name in HIDES_MEMBERS_NAME_LIST
|
||||
shouldProcessExtensionsBeforeMembers = name in HIDES_MEMBERS_NAME_LIST,
|
||||
shouldProcessExplicitReceiverScopeOnly = explicitReceiver?.typeRef?.coneTypeSafe<ConeIntegerLiteralType>() != null
|
||||
)
|
||||
val bestCandidates = result.bestCandidates()
|
||||
val reducedCandidates = if (result.currentApplicability < CandidateApplicability.SYNTHETIC_RESOLVED) {
|
||||
|
||||
@@ -184,7 +184,8 @@ class FirTowerResolver(
|
||||
fun runResolver(
|
||||
consumer: TowerDataConsumer,
|
||||
implicitReceiverValues: List<ImplicitReceiverValue<*>>,
|
||||
shouldProcessExtensionsBeforeMembers: Boolean = false
|
||||
shouldProcessExtensionsBeforeMembers: Boolean = false,
|
||||
shouldProcessExplicitReceiverScopeOnly: Boolean = false
|
||||
): CandidateCollector {
|
||||
this.implicitReceiverValues = implicitReceiverValues
|
||||
towerDataConsumer = consumer
|
||||
@@ -203,6 +204,10 @@ class FirTowerResolver(
|
||||
// fun test(f: Foo) { f.x }
|
||||
towerDataConsumer.consume(EMPTY, TowerScopeLevel.Empty, group++)
|
||||
|
||||
if (shouldProcessExplicitReceiverScopeOnly) {
|
||||
return collector
|
||||
}
|
||||
|
||||
// Member of local scope
|
||||
// fun test(x: Int) = x
|
||||
val nonEmptyLocalScopes = mutableListOf<FirLocalScope>()
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ fun foo() = 1
|
||||
val nonConst = foo()
|
||||
|
||||
annotation class ValidAnn(
|
||||
val p1: Int = 1 <!AMBIGUITY!>+<!> CONST,
|
||||
val p1: Int = 1 + CONST,
|
||||
val p2: String = "",
|
||||
val p3: KClass<*> = String::class,
|
||||
val p4: IntArray = intArrayOf(1, 2, 3),
|
||||
|
||||
Reference in New Issue
Block a user