FIR resolve: record & check implicit extension receiver type properly
This commit is contained in:
@@ -36,7 +36,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
|
|||||||
import org.jetbrains.kotlin.resolve.calls.model.PostponedResolvedAtomMarker
|
import org.jetbrains.kotlin.resolve.calls.model.PostponedResolvedAtomMarker
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||||
import java.util.*
|
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
import kotlin.coroutines.intrinsics.createCoroutineUnintercepted
|
import kotlin.coroutines.intrinsics.createCoroutineUnintercepted
|
||||||
|
|
||||||
@@ -92,6 +91,7 @@ class CheckerSinkImpl(override val components: InferenceComponents, var continua
|
|||||||
class Candidate(
|
class Candidate(
|
||||||
val symbol: ConeSymbol,
|
val symbol: ConeSymbol,
|
||||||
val dispatchReceiverValue: ClassDispatchReceiverValue?,
|
val dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
val implicitExtensionReceiverValue: ImplicitReceiverValue?,
|
||||||
val explicitReceiverKind: ExplicitReceiverKind,
|
val explicitReceiverKind: ExplicitReceiverKind,
|
||||||
private val inferenceComponents: InferenceComponents,
|
private val inferenceComponents: InferenceComponents,
|
||||||
private val baseSystem: ConstraintStorage
|
private val baseSystem: ConstraintStorage
|
||||||
@@ -146,7 +146,11 @@ interface TowerScopeLevel {
|
|||||||
): ProcessorAction
|
): ProcessorAction
|
||||||
|
|
||||||
interface TowerScopeLevelProcessor<T : ConeSymbol> {
|
interface TowerScopeLevelProcessor<T : ConeSymbol> {
|
||||||
fun consumeCandidate(symbol: T, dispatchReceiverValue: ClassDispatchReceiverValue?): ProcessorAction
|
fun consumeCandidate(
|
||||||
|
symbol: T,
|
||||||
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?
|
||||||
|
): ProcessorAction
|
||||||
}
|
}
|
||||||
|
|
||||||
object Empty : TowerScopeLevel {
|
object Empty : TowerScopeLevel {
|
||||||
@@ -183,7 +187,7 @@ abstract class SessionBasedTowerLevel(val session: FirSession) : TowerScopeLevel
|
|||||||
class MemberScopeTowerLevel(
|
class MemberScopeTowerLevel(
|
||||||
session: FirSession,
|
session: FirSession,
|
||||||
val dispatchReceiver: ReceiverValue,
|
val dispatchReceiver: ReceiverValue,
|
||||||
val implicitExtensionReceiver: ReceiverValue? = null
|
val implicitExtensionReceiver: ImplicitReceiverValue? = null
|
||||||
) : SessionBasedTowerLevel(session) {
|
) : SessionBasedTowerLevel(session) {
|
||||||
|
|
||||||
private fun <T : ConeSymbol> processMembers(
|
private fun <T : ConeSymbol> processMembers(
|
||||||
@@ -198,9 +202,9 @@ class MemberScopeTowerLevel(
|
|||||||
if (candidate is ConeCallableSymbol && candidate.hasConsistentExtensionReceiver(extensionReceiver)) {
|
if (candidate is ConeCallableSymbol && candidate.hasConsistentExtensionReceiver(extensionReceiver)) {
|
||||||
// NB: we do not check dispatchReceiverValue != null here,
|
// NB: we do not check dispatchReceiverValue != null here,
|
||||||
// because of objects & constructors (see comments in dispatchReceiverValue() implementation)
|
// because of objects & constructors (see comments in dispatchReceiverValue() implementation)
|
||||||
output.consumeCandidate(candidate, candidate.dispatchReceiverValue())
|
output.consumeCandidate(candidate, candidate.dispatchReceiverValue(), implicitExtensionReceiver)
|
||||||
} else if (candidate is ConeClassLikeSymbol) {
|
} else if (candidate is ConeClassLikeSymbol) {
|
||||||
output.consumeCandidate(candidate, null)
|
output.consumeCandidate(candidate, null, implicitExtensionReceiver)
|
||||||
} else {
|
} else {
|
||||||
ProcessorAction.NEXT
|
ProcessorAction.NEXT
|
||||||
}
|
}
|
||||||
@@ -208,7 +212,7 @@ class MemberScopeTowerLevel(
|
|||||||
) return ProcessorAction.STOP
|
) return ProcessorAction.STOP
|
||||||
val withSynthetic = FirSyntheticPropertiesScope(session, scope, ReturnTypeCalculatorWithJump(session))
|
val withSynthetic = FirSyntheticPropertiesScope(session, scope, ReturnTypeCalculatorWithJump(session))
|
||||||
return withSynthetic.processScopeMembers { symbol ->
|
return withSynthetic.processScopeMembers { symbol ->
|
||||||
output.consumeCandidate(symbol, symbol.dispatchReceiverValue())
|
output.consumeCandidate(symbol, symbol.dispatchReceiverValue(), implicitExtensionReceiver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,7 +250,7 @@ private fun ConeCallableSymbol.hasExtensionReceiver(): Boolean = (this as? FirCa
|
|||||||
class ScopeTowerLevel(
|
class ScopeTowerLevel(
|
||||||
session: FirSession,
|
session: FirSession,
|
||||||
val scope: FirScope,
|
val scope: FirScope,
|
||||||
val implicitExtensionReceiver: ReceiverValue? = null
|
val implicitExtensionReceiver: ImplicitReceiverValue? = null
|
||||||
) : SessionBasedTowerLevel(session) {
|
) : SessionBasedTowerLevel(session) {
|
||||||
override fun <T : ConeSymbol> processElementsByName(
|
override fun <T : ConeSymbol> processElementsByName(
|
||||||
token: TowerScopeLevel.Token<T>,
|
token: TowerScopeLevel.Token<T>,
|
||||||
@@ -262,22 +266,27 @@ class ScopeTowerLevel(
|
|||||||
|
|
||||||
TowerScopeLevel.Token.Properties -> scope.processPropertiesByName(name) { candidate ->
|
TowerScopeLevel.Token.Properties -> scope.processPropertiesByName(name) { candidate ->
|
||||||
if (candidate.hasConsistentExtensionReceiver(extensionReceiver) && candidate.dispatchReceiverValue() == null) {
|
if (candidate.hasConsistentExtensionReceiver(extensionReceiver) && candidate.dispatchReceiverValue() == null) {
|
||||||
processor.consumeCandidate(candidate as T, dispatchReceiverValue = null)
|
processor.consumeCandidate(
|
||||||
|
candidate as T, dispatchReceiverValue = null,
|
||||||
|
implicitExtensionReceiverValue = implicitExtensionReceiver
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
ProcessorAction.NEXT
|
ProcessorAction.NEXT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TowerScopeLevel.Token.Functions -> scope.processFunctionsByName(name) { candidate ->
|
TowerScopeLevel.Token.Functions -> scope.processFunctionsByName(name) { candidate ->
|
||||||
if (candidate.hasConsistentExtensionReceiver(extensionReceiver) && candidate.dispatchReceiverValue() == null) {
|
if (candidate.hasConsistentExtensionReceiver(extensionReceiver) && candidate.dispatchReceiverValue() == null) {
|
||||||
processor.consumeCandidate(candidate as T, dispatchReceiverValue = null)
|
processor.consumeCandidate(
|
||||||
|
candidate as T, dispatchReceiverValue = null,
|
||||||
|
implicitExtensionReceiverValue = implicitExtensionReceiver)
|
||||||
} else {
|
} else {
|
||||||
ProcessorAction.NEXT
|
ProcessorAction.NEXT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TowerScopeLevel.Token.Objects -> scope.processClassifiersByNameWithAction(name, FirPosition.OTHER) {
|
TowerScopeLevel.Token.Objects -> scope.processClassifiersByNameWithAction(name, FirPosition.OTHER) {
|
||||||
processor.consumeCandidate(
|
processor.consumeCandidate(
|
||||||
it as T,
|
it as T, dispatchReceiverValue = null,
|
||||||
dispatchReceiverValue = null
|
implicitExtensionReceiverValue = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,13 +318,13 @@ class QualifiedReceiverTowerLevel(session: FirSession) : SessionBasedTowerLevel(
|
|||||||
|
|
||||||
return if (token == TowerScopeLevel.Token.Objects) {
|
return if (token == TowerScopeLevel.Token.Objects) {
|
||||||
scope.processClassifiersByNameWithAction(name, FirPosition.OTHER) {
|
scope.processClassifiersByNameWithAction(name, FirPosition.OTHER) {
|
||||||
processor.consumeCandidate(it as T, null)
|
processor.consumeCandidate(it as T, null, null)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scope.processCallables(name, token.cast()) {
|
scope.processCallables(name, token.cast()) {
|
||||||
val fir = it.firUnsafe<FirCallableMemberDeclaration>()
|
val fir = it.firUnsafe<FirCallableMemberDeclaration>()
|
||||||
if (fir.isStatic || it.callableId.classId == null) {
|
if (fir.isStatic || it.callableId.classId == null) {
|
||||||
processor.consumeCandidate(it as T, null)
|
processor.consumeCandidate(it as T, null, null)
|
||||||
} else {
|
} else {
|
||||||
ProcessorAction.NEXT
|
ProcessorAction.NEXT
|
||||||
}
|
}
|
||||||
@@ -346,14 +355,19 @@ class QualifiedReceiverTowerDataConsumer<T : ConeSymbol>(
|
|||||||
name,
|
name,
|
||||||
explicitReceiver,
|
explicitReceiver,
|
||||||
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
||||||
override fun consumeCandidate(symbol: T, dispatchReceiverValue: ClassDispatchReceiverValue?): ProcessorAction {
|
override fun consumeCandidate(
|
||||||
|
symbol: T,
|
||||||
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?
|
||||||
|
): ProcessorAction {
|
||||||
assert(dispatchReceiverValue == null)
|
assert(dispatchReceiverValue == null)
|
||||||
resultCollector.consumeCandidate(
|
resultCollector.consumeCandidate(
|
||||||
group,
|
group,
|
||||||
candidateFactory.createCandidate(
|
candidateFactory.createCandidate(
|
||||||
symbol,
|
symbol,
|
||||||
null,
|
dispatchReceiverValue = null,
|
||||||
ExplicitReceiverKind.NO_EXPLICIT_RECEIVER
|
implicitExtensionReceiverValue = null,
|
||||||
|
explicitReceiverKind = ExplicitReceiverKind.NO_EXPLICIT_RECEIVER
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return ProcessorAction.NEXT
|
return ProcessorAction.NEXT
|
||||||
@@ -500,12 +514,17 @@ class ExplicitReceiverTowerDataConsumer<T : ConeSymbol>(
|
|||||||
name,
|
name,
|
||||||
explicitReceiver = null,
|
explicitReceiver = null,
|
||||||
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
||||||
override fun consumeCandidate(symbol: T, dispatchReceiverValue: ClassDispatchReceiverValue?): ProcessorAction {
|
override fun consumeCandidate(
|
||||||
|
symbol: T,
|
||||||
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?
|
||||||
|
): ProcessorAction {
|
||||||
resultCollector.consumeCandidate(
|
resultCollector.consumeCandidate(
|
||||||
group,
|
group,
|
||||||
candidateFactory.createCandidate(
|
candidateFactory.createCandidate(
|
||||||
symbol,
|
symbol,
|
||||||
dispatchReceiverValue,
|
dispatchReceiverValue,
|
||||||
|
implicitExtensionReceiverValue,
|
||||||
ExplicitReceiverKind.DISPATCH_RECEIVER
|
ExplicitReceiverKind.DISPATCH_RECEIVER
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -520,12 +539,17 @@ class ExplicitReceiverTowerDataConsumer<T : ConeSymbol>(
|
|||||||
name,
|
name,
|
||||||
explicitReceiver = explicitReceiver,
|
explicitReceiver = explicitReceiver,
|
||||||
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
||||||
override fun consumeCandidate(symbol: T, dispatchReceiverValue: ClassDispatchReceiverValue?): ProcessorAction {
|
override fun consumeCandidate(
|
||||||
|
symbol: T,
|
||||||
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?
|
||||||
|
): ProcessorAction {
|
||||||
resultCollector.consumeCandidate(
|
resultCollector.consumeCandidate(
|
||||||
group,
|
group,
|
||||||
candidateFactory.createCandidate(
|
candidateFactory.createCandidate(
|
||||||
symbol,
|
symbol,
|
||||||
dispatchReceiverValue,
|
dispatchReceiverValue,
|
||||||
|
implicitExtensionReceiverValue,
|
||||||
ExplicitReceiverKind.EXTENSION_RECEIVER
|
ExplicitReceiverKind.EXTENSION_RECEIVER
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -562,12 +586,17 @@ class NoExplicitReceiverTowerDataConsumer<T : ConeSymbol>(
|
|||||||
name,
|
name,
|
||||||
explicitReceiver = null,
|
explicitReceiver = null,
|
||||||
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
processor = object : TowerScopeLevel.TowerScopeLevelProcessor<T> {
|
||||||
override fun consumeCandidate(symbol: T, dispatchReceiverValue: ClassDispatchReceiverValue?): ProcessorAction {
|
override fun consumeCandidate(
|
||||||
|
symbol: T,
|
||||||
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?
|
||||||
|
): ProcessorAction {
|
||||||
resultCollector.consumeCandidate(
|
resultCollector.consumeCandidate(
|
||||||
group,
|
group,
|
||||||
candidateFactory.createCandidate(
|
candidateFactory.createCandidate(
|
||||||
symbol,
|
symbol,
|
||||||
dispatchReceiverValue,
|
dispatchReceiverValue,
|
||||||
|
implicitExtensionReceiverValue,
|
||||||
ExplicitReceiverKind.NO_EXPLICIT_RECEIVER
|
ExplicitReceiverKind.NO_EXPLICIT_RECEIVER
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ class CandidateFactory(
|
|||||||
fun createCandidate(
|
fun createCandidate(
|
||||||
symbol: ConeSymbol,
|
symbol: ConeSymbol,
|
||||||
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
dispatchReceiverValue: ClassDispatchReceiverValue?,
|
||||||
|
implicitExtensionReceiverValue: ImplicitReceiverValue?,
|
||||||
explicitReceiverKind: ExplicitReceiverKind
|
explicitReceiverKind: ExplicitReceiverKind
|
||||||
): Candidate {
|
): Candidate {
|
||||||
return Candidate(symbol, dispatchReceiverValue, explicitReceiverKind, inferenceComponents, baseSystem)
|
return Candidate(
|
||||||
|
symbol, dispatchReceiverValue, implicitExtensionReceiverValue,
|
||||||
|
explicitReceiverKind, inferenceComponents, baseSystem
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,23 +98,35 @@ internal sealed class CheckReceivers : ResolutionStage() {
|
|||||||
abstract fun ExplicitReceiverKind.shouldBeResolvedAsImplicit(): Boolean
|
abstract fun ExplicitReceiverKind.shouldBeResolvedAsImplicit(): Boolean
|
||||||
|
|
||||||
override suspend fun check(candidate: Candidate, sink: CheckerSink, callInfo: CallInfo) {
|
override suspend fun check(candidate: Candidate, sink: CheckerSink, callInfo: CallInfo) {
|
||||||
val receiverParameterValue = candidate.getReceiverValue()
|
val expectedReceiverParameterValue = candidate.getReceiverValue()
|
||||||
val explicitReceiverExpression = callInfo.explicitReceiver
|
val explicitReceiverExpression = callInfo.explicitReceiver
|
||||||
val explicitReceiverKind = candidate.explicitReceiverKind
|
val explicitReceiverKind = candidate.explicitReceiverKind
|
||||||
|
|
||||||
if (receiverParameterValue != null) {
|
if (expectedReceiverParameterValue != null) {
|
||||||
if (explicitReceiverExpression != null && explicitReceiverKind.shouldBeResolvedAsExplicit()) {
|
if (explicitReceiverExpression != null && explicitReceiverKind.shouldBeResolvedAsExplicit()) {
|
||||||
resolveArgumentExpression(
|
resolveArgumentExpression(
|
||||||
candidate.csBuilder,
|
candidate.csBuilder,
|
||||||
explicitReceiverExpression,
|
argument = explicitReceiverExpression,
|
||||||
candidate.substitutor.substituteOrSelf(receiverParameterValue.type),
|
expectedType = candidate.substitutor.substituteOrSelf(expectedReceiverParameterValue.type),
|
||||||
explicitReceiverExpression.typeRef,
|
expectedTypeRef = explicitReceiverExpression.typeRef,
|
||||||
sink,
|
sink = sink,
|
||||||
isReceiver = true,
|
isReceiver = true,
|
||||||
isSafeCall = callInfo.isSafeCall,
|
isSafeCall = callInfo.isSafeCall,
|
||||||
typeProvider = callInfo.typeProvider,
|
typeProvider = callInfo.typeProvider,
|
||||||
acceptLambdaAtoms = { candidate.postponedAtoms += it }
|
acceptLambdaAtoms = { candidate.postponedAtoms += it }
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
val argumentExtensionReceiverValue = candidate.implicitExtensionReceiverValue
|
||||||
|
if (argumentExtensionReceiverValue != null && explicitReceiverKind.shouldBeResolvedAsImplicit()) {
|
||||||
|
resolvePlainArgumentType(
|
||||||
|
candidate.csBuilder,
|
||||||
|
argumentType = argumentExtensionReceiverValue.type,
|
||||||
|
expectedType = candidate.substitutor.substituteOrSelf(expectedReceiverParameterValue.type),
|
||||||
|
sink = sink,
|
||||||
|
isReceiver = true,
|
||||||
|
isSafeCall = callInfo.isSafeCall
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,3 +3,11 @@ fun String.foo() {}
|
|||||||
fun String.bar() {
|
fun String.bar() {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class My {
|
||||||
|
fun bar() {
|
||||||
|
foo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun My.foo() {}
|
||||||
@@ -4,3 +4,15 @@ FILE: extension.kt
|
|||||||
public final fun R|kotlin/String|.bar(): R|kotlin/Unit| {
|
public final fun R|kotlin/String|.bar(): R|kotlin/Unit| {
|
||||||
R|/foo|()
|
R|/foo|()
|
||||||
}
|
}
|
||||||
|
public final class My : R|kotlin/Any| {
|
||||||
|
public constructor(): R|My| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final fun bar(): R|kotlin/Unit| {
|
||||||
|
R|/foo|()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final fun R|My|.foo(): R|kotlin/Unit| {
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ FILE: arrayFirstOrNull.kt
|
|||||||
}
|
}
|
||||||
public final fun <T> R|kotlin/Array<out T>|.firstOrNullX(): R|T|? {
|
public final fun <T> R|kotlin/Array<out T>|.firstOrNullX(): R|T|? {
|
||||||
^firstOrNullX when () {
|
^firstOrNullX when () {
|
||||||
<Ambiguity: isEmpty, [kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/collections/isEmpty, kotlin/text/isEmpty]>#() -> {
|
R|kotlin/collections/isEmpty|<R|T|>() -> {
|
||||||
Null(null)
|
Null(null)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
|||||||
@@ -19,37 +19,37 @@ FILE: topLevelResolve.kt
|
|||||||
^id R|<local>/arg|
|
^id R|<local>/arg|
|
||||||
}
|
}
|
||||||
public final fun testMap(): R|kotlin/Unit| {
|
public final fun testMap(): R|kotlin/Unit| {
|
||||||
lval first: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Function1<kotlin/Int, kotlin/Int>| {
|
lval first: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
|
||||||
R|<local>/it|.R|kotlin/Int.times|(Int(2))
|
R|<local>/it|.R|kotlin/Int.times|(Int(2))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval second: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/intArrayOf|(Int(4), Int(5), Int(6)).R|kotlin/collections/map|<R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Function1<kotlin/Int, kotlin/Int>| {
|
lval second: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/intArrayOf|(Int(4), Int(5), Int(6)).R|kotlin/collections/map|<R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
|
||||||
R|<local>/it|.R|kotlin/Int.times|(Int(2))
|
R|<local>/it|.R|kotlin/Int.times|(Int(2))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval withId: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Function1<kotlin/Int, kotlin/Int>| {
|
lval withId: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1), Int(2), Int(3)).R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
|
||||||
R|/id|<R|kotlin/Int|>(R|<local>/it|)
|
R|/id|<R|kotlin/Int|>(R|<local>/it|)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval stringToInt: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/String|>(String(alpha), String(omega)).R|kotlin/collections/map|<R|kotlin/String|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Function1<kotlin/String, kotlin/Int>| {
|
lval stringToInt: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/String|>(String(alpha), String(omega)).R|kotlin/collections/map|<R|kotlin/String|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Int| {
|
||||||
R|<local>/it|.R|kotlin/String.length|
|
R|<local>/it|.R|kotlin/String.length|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval viaWith: R|kotlin/Nothing| = R|kotlin/with|<R|kotlin/collections/List<kotlin/Int>|, R|kotlin/Nothing|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(42)), <L> = with@fun R|kotlin/collections/List<kotlin/Int>|.<anonymous>(it: R|kotlin/collections/List<kotlin/Int>|): R|kotlin/Function2<kotlin/collections/List<kotlin/Int>, kotlin/collections/List<kotlin/Int>, kotlin/Nothing>| {
|
lval viaWith: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/with|<R|kotlin/collections/List<kotlin/Int>|, R|kotlin/collections/List<kotlin/Int>|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(42)), <L> = with@fun R|kotlin/collections/List<kotlin/Int>|.<anonymous>(it: R|kotlin/collections/List<kotlin/Int>|): R|kotlin/collections/List<kotlin/Int>| {
|
||||||
<Ambiguity: map, [kotlin/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/collections/map, kotlin/sequences/map, kotlin/text/map]>#(<L> = map@fun <implicit>.<anonymous>(): <implicit> {
|
R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/Int|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
|
||||||
it#.times#(it#)
|
R|<local>/it|.R|kotlin/Int.times|(R|<local>/it|)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
public final fun testWith(): R|kotlin/Unit| {
|
public final fun testWith(): R|kotlin/Unit| {
|
||||||
lval length: R|kotlin/Int| = R|kotlin/with|<R|kotlin/String|, R|kotlin/Int|>(String(), <L> = with@fun R|kotlin/String|.<anonymous>(it: R|kotlin/String|): R|kotlin/Function2<kotlin/String, kotlin/String, kotlin/Int>| {
|
lval length: R|kotlin/Int| = R|kotlin/with|<R|kotlin/String|, R|kotlin/Int|>(String(), <L> = with@fun R|kotlin/String|.<anonymous>(it: R|kotlin/String|): R|kotlin/Int| {
|
||||||
R|kotlin/String.length|
|
R|kotlin/String.length|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval indices: R|kotlin/Nothing| = R|kotlin/with|<R|kotlin/String|, R|kotlin/Nothing|>(String(), <L> = with@fun R|kotlin/String|.<anonymous>(it: R|kotlin/String|): R|kotlin/Function2<kotlin/String, kotlin/String, kotlin/Nothing>| {
|
lval indices: R|kotlin/ranges/IntRange| = R|kotlin/with|<R|kotlin/String|, R|kotlin/ranges/IntRange|>(String(), <L> = with@fun R|kotlin/String|.<anonymous>(it: R|kotlin/String|): R|kotlin/ranges/IntRange| {
|
||||||
<Ambiguity: indices, [kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/collections/indices, kotlin/text/indices]>#
|
R|kotlin/text/indices|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
lval indicesNoWith: R|kotlin/ranges/IntRange| = String().R|kotlin/text/indices|
|
lval indicesNoWith: R|kotlin/ranges/IntRange| = String().R|kotlin/text/indices|
|
||||||
|
|||||||
+1
-1
@@ -37,6 +37,6 @@ FILE fqName:<root> fileName:/calls.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun ext3 (x: kotlin.Int): kotlin.Int declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun ext3 (x: kotlin.Int): kotlin.Int declared in <root>'
|
||||||
CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||||
x: ERROR_CALL 'Unresolved reference: <Unresolved name: ext1>#' type=IrErrorType
|
x: CALL 'public final fun ext1 (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||||
y: GET_VAR 'x: kotlin.Int declared in <root>.ext3' type=kotlin.Int origin=null
|
y: GET_VAR 'x: kotlin.Int declared in <root>.ext3' type=kotlin.Int origin=null
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -5,8 +5,7 @@ FILE fqName:<root> fileName:/extensionPropertyGetterCall.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun <get-okext> (): kotlin.String declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun <get-okext> (): kotlin.String declared in <root>'
|
||||||
CONST String type=kotlin.String value="OK"
|
CONST String type=kotlin.String value="OK"
|
||||||
FUN name:test5 visibility:public modality:FINAL <> () returnType:IrErrorType
|
FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun test5 (): IrErrorType declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in <root>'
|
||||||
ERROR_CALL 'Unresolved reference: <Unresolved name: okext>#' type=IrErrorType
|
CALL 'public final fun <get-okext> (): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ FILE fqName:<root> fileName:/references.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun <get-okext> (): kotlin.String declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun <get-okext> (): kotlin.String declared in <root>'
|
||||||
CONST String type=kotlin.String value="OK"
|
CONST String type=kotlin.String value="OK"
|
||||||
FUN name:test5 visibility:public modality:FINAL <> () returnType:IrErrorType
|
FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun test5 (): IrErrorType declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in <root>'
|
||||||
ERROR_CALL 'Unresolved reference: <Unresolved name: okext>#' type=IrErrorType
|
CALL 'public final fun <get-okext> (): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -9,5 +9,4 @@ FILE fqName:<root> fileName:/samAdapter.kt
|
|||||||
ERROR_CALL 'Unresolved reference: println#' type=IrErrorType
|
ERROR_CALL 'Unresolved reference: println#' type=IrErrorType
|
||||||
CONST String type=IrErrorType value="Hello, world!"
|
CONST String type=IrErrorType value="Hello, world!"
|
||||||
FUNCTION_REFERENCE 'local final fun <anonymous> (): IrErrorType declared in <root>.test1' type=IrErrorType origin=LAMBDA
|
FUNCTION_REFERENCE 'local final fun <anonymous> (): IrErrorType declared in <root>.test1' type=IrErrorType origin=LAMBDA
|
||||||
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [kotlin/run]>#' type=IrErrorType
|
ERROR_CALL 'Unresolved reference: <Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/run]>#' type=IrErrorType
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user