Skip to content

Commit

Permalink
[FIR] Remove code that checks for isInner and origin in `collectC…
Browse files Browse the repository at this point in the history
…andidates`

It will help to avoid filtering out of inner type aliases with noninner RHS:
`inner typealias TA = List<T>` where `T` is an outer type parameter.

`isInner` check is not actual because `ConstructorFilter` on
a level above actually does the same check.

The check on `FirDeclarationOrigin.SamConstructor` was introduced by 907ebb3,
but the related test remains green if the check is removed.

KT-73010
  • Loading branch information
KvanTTT authored and Space Team committed Nov 19, 2024
1 parent ab6bdbb commit d51fb6d
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.fakeElement
import org.jetbrains.kotlin.fir.*
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.utils.isInner
import org.jetbrains.kotlin.fir.declarations.utils.isStatic
import org.jetbrains.kotlin.fir.expressions.FirExpression
import org.jetbrains.kotlin.fir.expressions.FirSmartCastExpression
Expand Down Expand Up @@ -230,13 +229,6 @@ class DispatchReceiverMemberScopeTowerLevel(
processScopeMembers { candidate ->
empty = false
if (candidate.hasConsistentExtensionReceiver(givenExtensionReceiverOptions)) {
val fir = candidate.fir
// Calls on a dispatch receiver cannot be:
// - a constructor call unless it's an inner class
// - a SAM constructor call
if ((fir as? FirConstructor)?.isInner == false || fir.origin == FirDeclarationOrigin.SamConstructor) {
return@processScopeMembers
}
result += MemberWithBaseScope(candidate, this)
}
}
Expand Down

0 comments on commit d51fb6d

Please sign in to comment.