[FIR] Provide object [dispatch] && callable reference receivers properly
This commit is contained in:
+5
-5
@@ -26,10 +26,10 @@ FILE: importedReceiver.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
Int(42).R|/foo|<R|kotlin/Int|>()
|
||||
String().R|/foo|<R|kotlin/String|>()
|
||||
Int(42).R|/My.bar|<R|kotlin/Int|>()
|
||||
String().R|/My.bar|<R|kotlin/String|>()
|
||||
R|/My.baz|()
|
||||
Boolean(true).R|/My.gau|()
|
||||
(Q|My|, Int(42)).R|/My.bar|<R|kotlin/Int|>()
|
||||
(Q|My|, String()).R|/My.bar|<R|kotlin/String|>()
|
||||
Q|My|.R|/My.baz|()
|
||||
(Q|My|, Boolean(true)).R|/My.gau|()
|
||||
R|/Your.wat|()
|
||||
Boolean(false).R|FakeOverride</My.watwat: R|kotlin/Unit|>|<R|kotlin/Boolean|>()
|
||||
(Q|My|, Boolean(false)).R|FakeOverride</My.watwat: R|kotlin/Unit|>|<R|kotlin/Boolean|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ FILE: a.kt
|
||||
}
|
||||
FILE: b.kt
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
R|a/A.foo|()
|
||||
Q|a/A|.R|a/A.foo|()
|
||||
}
|
||||
|
||||
-20
@@ -5,12 +5,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.backend.generators
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.fir.backend.*
|
||||
import org.jetbrains.kotlin.fir.backend.convertWithOffsets
|
||||
import org.jetbrains.kotlin.fir.declarations.FirAnonymousObject
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirNoReceiverExpression
|
||||
import org.jetbrains.kotlin.fir.psi
|
||||
@@ -19,7 +15,6 @@ import org.jetbrains.kotlin.fir.references.FirReference
|
||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||
import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.resolve.firSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
@@ -37,7 +32,6 @@ import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.classifierOrNull
|
||||
import org.jetbrains.kotlin.ir.types.makeNotNull
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.psi.KtPropertyDelegate
|
||||
|
||||
internal class CallAndReferenceGenerator(
|
||||
@@ -373,20 +367,6 @@ internal class CallAndReferenceGenerator(
|
||||
}
|
||||
visitor.convertToIrExpression(it)
|
||||
}
|
||||
?: run {
|
||||
// Object case
|
||||
val callableReference = calleeReference as? FirResolvedNamedReference
|
||||
val ownerClassId = (callableReference?.resolvedSymbol as? FirCallableSymbol<*>)?.callableId?.classId
|
||||
val ownerClassSymbol =
|
||||
ownerClassId?.takeUnless { it.isLocal }?.let { session.firSymbolProvider.getClassLikeSymbolByFqName(it) }
|
||||
val firClass = (ownerClassSymbol?.fir as? FirClass)?.takeIf {
|
||||
it is FirAnonymousObject || it is FirRegularClass && it.classKind == ClassKind.OBJECT
|
||||
}
|
||||
firClass?.convertWithOffsets { startOffset, endOffset ->
|
||||
val irClass = classifierStorage.getCachedIrClass(firClass)!!
|
||||
IrGetObjectValueImpl(startOffset, endOffset, irClass.defaultType, irClass.symbol)
|
||||
}
|
||||
}
|
||||
?: run {
|
||||
if (this is FirCallableReferenceAccess) return null
|
||||
val name = if (isDispatch) "Dispatch" else "Extension"
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.fir.expressions.FirArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.FirEmptyArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.buildArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirExpressionStub
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirNoReceiverExpression
|
||||
import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents
|
||||
import org.jetbrains.kotlin.fir.resolve.DoubleColonLHS
|
||||
@@ -116,13 +117,16 @@ class Candidate(
|
||||
val diagnostics: MutableList<ResolutionDiagnostic> = mutableListOf()
|
||||
|
||||
fun dispatchReceiverExpression(): FirExpression = when (explicitReceiverKind) {
|
||||
ExplicitReceiverKind.DISPATCH_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS -> callInfo.explicitReceiver!!
|
||||
ExplicitReceiverKind.DISPATCH_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS ->
|
||||
callInfo.explicitReceiver?.takeIf { it !is FirExpressionStub } ?: FirNoReceiverExpression
|
||||
else -> dispatchReceiverValue?.receiverExpression ?: FirNoReceiverExpression
|
||||
}
|
||||
|
||||
fun extensionReceiverExpression(): FirExpression = when (explicitReceiverKind) {
|
||||
ExplicitReceiverKind.EXTENSION_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS -> callInfo.explicitReceiver!!
|
||||
else -> implicitExtensionReceiverValue?.receiverExpression ?: FirNoReceiverExpression
|
||||
ExplicitReceiverKind.EXTENSION_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS ->
|
||||
callInfo.explicitReceiver?.takeIf { it !is FirExpressionStub } ?: FirNoReceiverExpression
|
||||
else ->
|
||||
implicitExtensionReceiverValue?.receiverExpression ?: FirNoReceiverExpression
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
+40
-14
@@ -5,18 +5,24 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.resolve.calls.tower
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirCallableMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirConstructor
|
||||
import org.jetbrains.kotlin.fir.declarations.isInner
|
||||
import org.jetbrains.kotlin.fir.declarations.isStatic
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.buildResolvedQualifier
|
||||
import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.*
|
||||
import org.jetbrains.kotlin.fir.resolve.firSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
||||
import org.jetbrains.kotlin.fir.resolve.typeForQualifier
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirAbstractImportingScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirExplicitSimpleImportingScope
|
||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.fir.types.classId
|
||||
@@ -183,6 +189,37 @@ class ScopeTowerLevel(
|
||||
else -> true
|
||||
}
|
||||
|
||||
private fun dispatchReceiverValue(scope: FirScope, candidate: FirCallableSymbol<*>): ReceiverValue? {
|
||||
val holderId = candidate.callableId.classId
|
||||
if (holderId != null && scope is FirExplicitSimpleImportingScope) {
|
||||
val symbol = session.firSymbolProvider.getClassLikeSymbolByFqName(holderId)
|
||||
if (symbol is FirRegularClassSymbol &&
|
||||
symbol.fir.classKind.let { it == ClassKind.OBJECT || it == ClassKind.ENUM_ENTRY }
|
||||
) {
|
||||
val resolvedQualifier = buildResolvedQualifier {
|
||||
packageFqName = holderId.packageFqName
|
||||
relativeClassFqName = holderId.relativeClassName
|
||||
safe = false
|
||||
this.symbol = symbol
|
||||
}.apply {
|
||||
resultType = bodyResolveComponents.typeForQualifier(this)
|
||||
}
|
||||
return ExpressionReceiverValue(resolvedQualifier)
|
||||
}
|
||||
}
|
||||
return when {
|
||||
candidate !is FirBackingFieldSymbol -> null
|
||||
candidate.callableId.classId != null -> {
|
||||
bodyResolveComponents.implicitReceiverStack.lastDispatchReceiver { implicitReceiverValue ->
|
||||
implicitReceiverValue.type.classId == holderId
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
bodyResolveComponents.implicitReceiverStack.lastDispatchReceiver()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun <T : AbstractFirBasedSymbol<*>> processElementsByName(
|
||||
token: TowerScopeLevel.Token<T>,
|
||||
name: Name,
|
||||
@@ -194,19 +231,7 @@ class ScopeTowerLevel(
|
||||
TowerScopeLevel.Token.Properties -> scope.processPropertiesByName(name) { candidate ->
|
||||
empty = false
|
||||
if (candidate.hasConsistentReceivers(extensionReceiver)) {
|
||||
val dispatchReceiverValue =
|
||||
when {
|
||||
candidate !is FirBackingFieldSymbol -> null
|
||||
candidate.callableId.classId != null -> {
|
||||
val propertyHolderId = candidate.callableId.classId
|
||||
bodyResolveComponents.implicitReceiverStack.lastDispatchReceiver { implicitReceiverValue ->
|
||||
implicitReceiverValue.type.classId == propertyHolderId
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
bodyResolveComponents.implicitReceiverStack.lastDispatchReceiver()
|
||||
}
|
||||
}
|
||||
val dispatchReceiverValue = dispatchReceiverValue(scope, candidate)
|
||||
processor.consumeCandidate(
|
||||
candidate as T, dispatchReceiverValue,
|
||||
implicitExtensionReceiverValue = extensionReceiver as? ImplicitReceiverValue<*>
|
||||
@@ -221,8 +246,9 @@ class ScopeTowerLevel(
|
||||
) { candidate ->
|
||||
empty = false
|
||||
if (candidate.hasConsistentReceivers(extensionReceiver)) {
|
||||
val dispatchReceiverValue = dispatchReceiverValue(scope, candidate)
|
||||
processor.consumeCandidate(
|
||||
candidate as T, dispatchReceiverValue = null,
|
||||
candidate as T, dispatchReceiverValue,
|
||||
implicitExtensionReceiverValue = extensionReceiver as? ImplicitReceiverValue<*>
|
||||
)
|
||||
}
|
||||
|
||||
+3
-1
@@ -126,7 +126,9 @@ class FirCallCompletionResultsWriterTransformer(
|
||||
resolvedSymbol = calleeReference.candidateSymbol
|
||||
inferredTypeArguments.addAll(computeTypeArgumentTypes(calleeReference.candidate))
|
||||
},
|
||||
).compose()
|
||||
).transformDispatchReceiver(StoreReceiver, subCandidate.dispatchReceiverExpression())
|
||||
.transformExtensionReceiver(StoreReceiver, subCandidate.extensionReceiverExpression())
|
||||
.compose()
|
||||
}
|
||||
|
||||
override fun transformVariableAssignment(
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
abstract class Base(val fn: () -> String)
|
||||
|
||||
class Outer {
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
enum class X {
|
||||
B {
|
||||
override val value = "OK"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import Host.x
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
import Host.x
|
||||
|
||||
object A {
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
package test
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo {
|
||||
|
||||
-4
@@ -63,8 +63,6 @@ FILE fqName:<root> fileName:/memberExtension.kt
|
||||
$receiver: CONST String type=kotlin.String value="K"
|
||||
host: GET_VAR '<this>: <root>.Host declared in <root>.Host' type=<root>.Host origin=null
|
||||
p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun <get-plusK> (): kotlin.String declared in <root>.Host' setter=null type=kotlin.reflect.KProperty2<kotlin.String, <root>.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Host
|
||||
$receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Host
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-plusK> visibility:public modality:FINAL <> ($this:<root>.Host, $receiver:kotlin.String) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
@@ -76,8 +74,6 @@ FILE fqName:<root> fileName:/memberExtension.kt
|
||||
receiver: GET_VAR '<this>: <root>.Host declared in <root>.Host.<get-plusK>' type=<root>.Host origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Host declared in <root>.Host.<get-plusK>' type=<root>.Host origin=null
|
||||
p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun <get-plusK> (): kotlin.String declared in <root>.Host' setter=null type=kotlin.reflect.KProperty2<kotlin.String, <root>.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Host
|
||||
$receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Host
|
||||
PROPERTY name:ok visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt
Vendored
+1
@@ -22,6 +22,7 @@ FILE fqName:<root> fileName:/withArgumentAdaptationAndReceiver.kt
|
||||
BLOCK_BODY
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/use]>#' type=IrErrorType
|
||||
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.IntArray, kotlin.String> origin=null reflectionTarget=<same>
|
||||
$this: GET_VAR '<this>: <root>.Host declared in <root>.Host.testImplicitThis' type=<root>.Host origin=null
|
||||
FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
FILE fqName:<root> fileName:/membersImportedFromObject.kt
|
||||
CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.A [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>.A'
|
||||
CONST Int type=kotlin.Int value=1
|
||||
FUN name:fooExt visibility:public modality:FINAL <> ($this:<root>.A, $receiver:kotlin.Int) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun fooExt (): kotlin.Int declared in <root>.A'
|
||||
CONST Int type=kotlin.Int value=2
|
||||
PROPERTY name:bar visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-bar> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-bar> (): kotlin.Int declared in <root>.A'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-bar>' type=<root>.A origin=null
|
||||
PROPERTY name:barExt visibility:public modality:FINAL [val]
|
||||
FUN name:<get-barExt> visibility:public modality:FINAL <> ($this:<root>.A, $receiver:kotlin.Int) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-barExt> (): kotlin.Int declared in <root>.A'
|
||||
CONST Int type=kotlin.Int value=43
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun foo (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null
|
||||
PROPERTY name:test2 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun <get-bar> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null
|
||||
PROPERTY name:test3 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final,static]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun fooExt (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
|
||||
$this: CONST Int type=kotlin.Int value=1
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test3> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null
|
||||
PROPERTY name:test4 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [final,static]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun <get-barExt> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CONST Int type=kotlin.Int value=1
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import A.foo
|
||||
import A.bar
|
||||
import A.fooExt
|
||||
|
||||
@@ -180,7 +180,7 @@ FILE fqName:<root> fileName:/useImportedMember.kt
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'public final fun f (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
|
||||
$this: CONST Boolean type=kotlin.Boolean value=true
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[<root>.BaseClass; <root>.I<kotlin.String>]' type=<root>.C
|
||||
$receiver: CONST Boolean type=kotlin.Boolean value=true
|
||||
arg1: CONST Int type=kotlin.Int value=3
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
@@ -211,7 +211,7 @@ FILE fqName:<root> fileName:/useImportedMember.kt
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'public final fun <get-ext> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CONST Int type=kotlin.Int value=5
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[<root>.BaseClass; <root>.I<kotlin.String>]' type=<root>.C
|
||||
$receiver: CONST Int type=kotlin.Int value=5
|
||||
arg1: CONST Int type=kotlin.Int value=6
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
@@ -233,7 +233,7 @@ FILE fqName:<root> fileName:/useImportedMember.kt
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'public final fun <get-g2> <T> (): T of <root>.C.<get-g2> declared in <root>.C' type=kotlin.String origin=GET_PROPERTY
|
||||
<T>: kotlin.String
|
||||
$this: CONST String type=kotlin.String value="8"
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[<root>.BaseClass; <root>.I<kotlin.String>]' type=<root>.C
|
||||
$receiver: CONST String type=kotlin.String value="8"
|
||||
arg1: CONST String type=kotlin.String value="8"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
@@ -244,7 +244,7 @@ FILE fqName:<root> fileName:/useImportedMember.kt
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'public open fun fromInterface <T> (): T of <root>.C.fromInterface [fake_override] declared in <root>.C' type=kotlin.Int origin=null
|
||||
<T>: kotlin.Int
|
||||
$this: CONST Int type=kotlin.Int value=9
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[<root>.BaseClass; <root>.I<kotlin.String>]' type=<root>.C
|
||||
$receiver: CONST Int type=kotlin.Int value=9
|
||||
arg1: CONST Int type=kotlin.Int value=9
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
|
||||
Reference in New Issue
Block a user