FIR resolve: support inferring property type from getter
This commit is contained in:
+78
-41
@@ -94,21 +94,12 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
|
||||
return data.compose()
|
||||
}
|
||||
|
||||
override fun transformFunction(function: FirFunction, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||
return withScopeCleanup(localScopes) {
|
||||
localScopes += FirLocalScope()
|
||||
super.transformFunction(function, data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun transformValueParameter(valueParameter: FirValueParameter, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||
localScopes.lastOrNull()?.storeDeclaration(valueParameter)
|
||||
if (valueParameter.returnTypeRef is FirImplicitTypeRef) return valueParameter.compose() // TODO
|
||||
return super.transformValueParameter(valueParameter, valueParameter.returnTypeRef)
|
||||
}
|
||||
|
||||
|
||||
private inline fun <T> withLabelAndReceiverType(labelName: Name, owner: FirElement, type: ConeKotlinType, block: () -> T): T {
|
||||
labels.put(labelName, type)
|
||||
when (owner) {
|
||||
@@ -871,34 +862,69 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
|
||||
return (annotationCall.transformChildren(this, data) as FirStatement).compose()
|
||||
}
|
||||
|
||||
override fun transformFunction(function: FirFunction, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||
return withScopeCleanup(localScopes) {
|
||||
localScopes += FirLocalScope()
|
||||
super.transformFunction(function, data)
|
||||
}
|
||||
}
|
||||
|
||||
private fun transformFunctionWithGivenSignature(
|
||||
function: FirFunction,
|
||||
returnTypeRef: FirTypeRef,
|
||||
receiverTypeRef: FirTypeRef? = null
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
if (function is FirNamedFunction) {
|
||||
localScopes.lastOrNull()?.storeDeclaration(function)
|
||||
}
|
||||
return withScopeCleanup(scopes) {
|
||||
scopes.addIfNotNull(receiverTypeRef?.coneTypeSafe<ConeKotlinType>()?.scope(session, scopeSession))
|
||||
|
||||
val result = transformFunction(function, returnTypeRef).single as FirFunction
|
||||
val body = result.body
|
||||
if (result is FirTypedDeclaration && result.returnTypeRef is FirImplicitTypeRef && body != null) {
|
||||
result.transformReturnTypeRef(this, body.resultType)
|
||||
result
|
||||
} else {
|
||||
result
|
||||
}.compose()
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformNamedFunction(namedFunction: FirNamedFunction, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||
if (namedFunction.returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return namedFunction.compose()
|
||||
if (namedFunction.returnTypeRef is FirImplicitTypeRef) {
|
||||
val returnTypeRef = namedFunction.returnTypeRef
|
||||
if ((returnTypeRef !is FirImplicitTypeRef || returnTypeRef is FirResolvedTypeRef) && implicitTypeOnly) {
|
||||
return namedFunction.compose()
|
||||
}
|
||||
if (returnTypeRef is FirImplicitTypeRef && returnTypeRef !is FirResolvedTypeRef) {
|
||||
namedFunction.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
}
|
||||
|
||||
val receiverTypeRef = namedFunction.receiverTypeRef
|
||||
fun transform(): CompositeTransformResult<FirDeclaration> {
|
||||
localScopes.lastOrNull()?.storeDeclaration(namedFunction)
|
||||
return withScopeCleanup(scopes) {
|
||||
scopes.addIfNotNull(receiverTypeRef?.coneTypeSafe<ConeKotlinType>()?.scope(session, scopeSession))
|
||||
|
||||
|
||||
val result = super.transformNamedFunction(namedFunction, namedFunction.returnTypeRef).single as FirNamedFunction
|
||||
val body = result.body
|
||||
if (result.returnTypeRef is FirImplicitTypeRef && body != null) {
|
||||
result.transformReturnTypeRef(this, body.resultType)
|
||||
result
|
||||
} else {
|
||||
result
|
||||
}.compose()
|
||||
}
|
||||
}
|
||||
|
||||
return if (receiverTypeRef != null) {
|
||||
withLabelAndReceiverType(namedFunction.name, namedFunction, receiverTypeRef.coneTypeUnsafe()) { transform() }
|
||||
withLabelAndReceiverType(namedFunction.name, namedFunction, receiverTypeRef.coneTypeUnsafe()) {
|
||||
transformFunctionWithGivenSignature(namedFunction, returnTypeRef, receiverTypeRef)
|
||||
}
|
||||
} else {
|
||||
transform()
|
||||
transformFunctionWithGivenSignature(namedFunction, returnTypeRef)
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformPropertyAccessor(propertyAccessor: FirPropertyAccessor, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||
if (propertyAccessor is FirDefaultPropertyAccessor || propertyAccessor.body == null) {
|
||||
return super.transformPropertyAccessor(propertyAccessor, data)
|
||||
}
|
||||
val returnTypeRef = propertyAccessor.returnTypeRef
|
||||
if ((returnTypeRef !is FirImplicitTypeRef || returnTypeRef is FirResolvedTypeRef) && implicitTypeOnly) {
|
||||
return propertyAccessor.compose()
|
||||
}
|
||||
if (returnTypeRef is FirImplicitTypeRef && returnTypeRef !is FirResolvedTypeRef && data !is FirResolvedTypeRef) {
|
||||
propertyAccessor.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
}
|
||||
return if (data is FirResolvedTypeRef && returnTypeRef !is FirResolvedTypeRef) {
|
||||
transformFunctionWithGivenSignature(propertyAccessor, data)
|
||||
} else {
|
||||
transformFunctionWithGivenSignature(propertyAccessor, returnTypeRef)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,17 +959,22 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
|
||||
)
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
variable is FirProperty && variable.getter !is FirDefaultPropertyAccessor -> {
|
||||
variable.transformReturnTypeRef(
|
||||
this,
|
||||
FirErrorTypeRefImpl(
|
||||
session, null,
|
||||
if (variable is FirProperty && variable.getter !is FirDefaultPropertyAccessor) {
|
||||
"Not supported: type from property getter"
|
||||
} else {
|
||||
"Cannot infer variable type without initializer / getter / delegate"
|
||||
}
|
||||
)
|
||||
when (val resultType = variable.getter.returnTypeRef) {
|
||||
is FirImplicitTypeRef -> FirErrorTypeRefImpl(
|
||||
session,
|
||||
null,
|
||||
"No result type for getter"
|
||||
)
|
||||
else -> resultType
|
||||
}
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
variable.transformReturnTypeRef(
|
||||
this, FirErrorTypeRefImpl(session, null, "Cannot infer variable type without initializer / getter / delegate")
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -966,13 +997,19 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
|
||||
localScopes.addIfNotNull(primaryConstructorParametersScope)
|
||||
withContainer(property) {
|
||||
property.transformChildrenWithoutAccessors(this, returnTypeRef)
|
||||
storeVariableReturnType(property)
|
||||
if (property.returnTypeRef is FirImplicitTypeRef && property.initializer != null) {
|
||||
storeVariableReturnType(property)
|
||||
}
|
||||
withScopeCleanup(localScopes) {
|
||||
localScopes.add(FirLocalScope().apply {
|
||||
storeBackingField(property)
|
||||
})
|
||||
val enhancedTypeRef = property.returnTypeRef
|
||||
var enhancedTypeRef = property.returnTypeRef
|
||||
property.getter.transform<FirDeclaration, Any?>(this, enhancedTypeRef)
|
||||
if (property.returnTypeRef is FirImplicitTypeRef) {
|
||||
storeVariableReturnType(property)
|
||||
enhancedTypeRef = property.returnTypeRef
|
||||
}
|
||||
property.setter?.let {
|
||||
it.transform<FirDeclaration, Any?>(this, enhancedTypeRef)
|
||||
it.valueParameters[0].transformReturnTypeRef(StoreType, enhancedTypeRef)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
val x get() = 1
|
||||
|
||||
val y: Int get() = 1
|
||||
|
||||
val z = 1
|
||||
get() = field
|
||||
|
||||
val w: Int get(): Int = 1
|
||||
|
||||
interface Some {
|
||||
val bar: Int get() = 1
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
FILE: typeFromGetter.kt
|
||||
public final val x: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(1)
|
||||
}
|
||||
public final val y: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(1)
|
||||
}
|
||||
public final val z: R|kotlin/Int| = Int(1)
|
||||
public get(): R|kotlin/Int| {
|
||||
^ F|/z|
|
||||
}
|
||||
public final val w: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(1)
|
||||
}
|
||||
public abstract interface Some : R|kotlin/Any| {
|
||||
public open val bar: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(1)
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -144,6 +144,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
||||
runTest("compiler/fir/resolve/testData/resolve/typeAliasWithGeneric.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeFromGetter.kt")
|
||||
public void testTypeFromGetter() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/typeFromGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeParameterInPropertyReceiver.kt")
|
||||
public void testTypeParameterInPropertyReceiver() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/typeParameterInPropertyReceiver.kt");
|
||||
|
||||
+4
-4
@@ -63,10 +63,10 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
|
||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test2.<no name provided>' type=<root>.test2.<no name provided> origin=null
|
||||
PROPERTY name:test3 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-test3> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-test3> visibility:public modality:FINAL <> () returnType:kotlin.Any
|
||||
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): kotlin.Any declared in <root>'
|
||||
BLOCK type=<root>.<get-test3>.<no name provided> origin=OBJECT_LITERAL
|
||||
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
||||
annotations:
|
||||
@@ -77,9 +77,9 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
|
||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.<get-test3>.<no name provided>' type=<root>.<get-test3>.<no name provided> origin=null
|
||||
FUN name:<set-test3> visibility:public modality:FINAL <> (v:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-test3> visibility:public modality:FINAL <> (v:kotlin.Any) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:v index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:v index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
BLOCK type=<root>.<set-test3>.<no name provided> origin=OBJECT_LITERAL
|
||||
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
FILE fqName:<root> fileName:/extensionProperties.kt
|
||||
PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-test1> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN 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> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-test2> visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-test2> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host
|
||||
@@ -22,23 +22,23 @@ FILE fqName:<root> fileName:/extensionProperties.kt
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:test3 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-test3> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-test3> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:test4 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-test4> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-test4> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-test4> visibility:public modality:FINAL <> ($this:<root>.Host, value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-test4> visibility:public modality:FINAL <> ($this:<root>.Host, value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
|
||||
@@ -34,22 +34,22 @@ FILE fqName:<root> fileName:/localClassWithOverrides.kt
|
||||
FIELD PROPERTY_BACKING_FIELD name:aval type:kotlin.Int visibility:public [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aval> visibility:public modality:FINAL <> ($this:<root>.outer.Local) returnType:IrErrorType
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aval> visibility:public modality:FINAL <> ($this:<root>.outer.Local) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:aval visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.outer.Local
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-aval> (): IrErrorType declared in <root>.outer.Local'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-aval> (): kotlin.Int declared in <root>.outer.Local'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aval type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.outer.Local declared in <root>.outer.Local.<get-aval>' type=<root>.outer.Local origin=null
|
||||
PROPERTY name:avar visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:public
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=2
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-avar> visibility:public modality:FINAL <> ($this:<root>.outer.Local) returnType:IrErrorType
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-avar> visibility:public modality:FINAL <> ($this:<root>.outer.Local) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:avar visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.outer.Local
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-avar> (): IrErrorType declared in <root>.outer.Local'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-avar> (): kotlin.Int declared in <root>.outer.Local'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:public ' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.outer.Local declared in <root>.outer.Local.<get-avar>' type=<root>.outer.Local origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-avar> visibility:public modality:FINAL <> ($this:<root>.outer.Local, <set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
|
||||
+36
-36
@@ -1,51 +1,51 @@
|
||||
FILE fqName:<root> fileName:/propertyAccessors.kt
|
||||
PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-test1> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN 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> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-test2> visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-test2> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
PROPERTY name:testExt1 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-testExt1> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-testExt1> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testExt1 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt1> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt1> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:testExt2 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-testExt2> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-testExt2> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt2> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt2> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-testExt2> visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-testExt2> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
PROPERTY name:testExt3 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-testExt3> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-testExt3> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testExt3 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt3> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt3> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:testExt4 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-testExt4> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-testExt4> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt4> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testExt4> (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-testExt4> visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-testExt4> visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host
|
||||
@@ -55,61 +55,61 @@ FILE fqName:<root> fileName:/propertyAccessors.kt
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:testMem1 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-testMem1> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMem1> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMem1 visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMem1> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMem1> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:testMem2 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-testMem2> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMem2> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMem2> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMem2> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-testMem2> visibility:public modality:FINAL <> ($this:<root>.Host, value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-testMem2> visibility:public modality:FINAL <> ($this:<root>.Host, value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
PROPERTY name:testMemExt1 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-testMemExt1> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMemExt1> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMemExt1 visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt1> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt1> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:testMemExt2 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-testMemExt2> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMemExt2> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt2> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt2> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-testMemExt2> visibility:public modality:FINAL <> ($this:<root>.Host, value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-testMemExt2> visibility:public modality:FINAL <> ($this:<root>.Host, value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
PROPERTY name:testMemExt3 visibility:public modality:FINAL [val]
|
||||
FUN name:<get-testMemExt3> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMemExt3> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMemExt3 visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt3> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt3> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
PROPERTY name:testMemExt4 visibility:public modality:FINAL [var]
|
||||
FUN name:<get-testMemExt4> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-testMemExt4> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt4> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-testMemExt4> (): kotlin.Int declared in <root>.Host'
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:<set-testMemExt4> visibility:public modality:FINAL <> ($this:<root>.Host, value:IrErrorType) returnType:kotlin.Unit
|
||||
FUN name:<set-testMemExt4> visibility:public modality:FINAL <> ($this:<root>.Host, value:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
VALUE_PARAMETER name:value index:0 type:IrErrorType
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
|
||||
@@ -13,10 +13,10 @@ FILE fqName:<root> fileName:/castToTypeParameter.kt
|
||||
TYPE_OP type=T of <root>.castExtFun origin=CAST typeOperand=T of <root>.castExtFun
|
||||
ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any
|
||||
PROPERTY name:castExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-castExtVal> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-castExtVal> visibility:public modality:FINAL <> () returnType:T of <uninitialized parent>
|
||||
correspondingProperty: PROPERTY name:castExtVal visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castExtVal> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castExtVal> (): T of <uninitialized parent> declared in <root>'
|
||||
TYPE_OP type=T of <uninitialized parent> origin=CAST typeOperand=T of <uninitialized parent>
|
||||
ERROR_CALL 'Unresolved reference: this#' type=IrErrorType
|
||||
CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
@@ -55,19 +55,19 @@ FILE fqName:<root> fileName:/castToTypeParameter.kt
|
||||
TYPE_OP type=TF of <root>.Host.castGenericMemberExtFun origin=CAST typeOperand=TF of <root>.Host.castGenericMemberExtFun
|
||||
ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any
|
||||
PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-castMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-castMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:T of <root>.Host
|
||||
correspondingProperty: PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castMemberExtVal> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castMemberExtVal> (): T of <root>.Host declared in <root>.Host'
|
||||
TYPE_OP type=T of <root>.Host origin=CAST typeOperand=T of <root>.Host
|
||||
ERROR_CALL 'Unresolved reference: this#' type=<root>.Host<T of <root>.Host>
|
||||
PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-castGenericMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-castGenericMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:TV of <uninitialized parent>
|
||||
correspondingProperty: PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castGenericMemberExtVal> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-castGenericMemberExtVal> (): TV of <uninitialized parent> declared in <root>.Host'
|
||||
TYPE_OP type=TV of <uninitialized parent> origin=CAST typeOperand=TV of <uninitialized parent>
|
||||
ERROR_CALL 'Unresolved reference: this#' type=<root>.Host<T of <root>.Host>
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
|
||||
@@ -27,12 +27,12 @@ FILE fqName:<root> fileName:/membersImportedFromObject.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [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) returnType:IrErrorType
|
||||
FUN name:<get-barExt> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-barExt> (): IrErrorType declared in <root>.A'
|
||||
CONST Int type=IrErrorType value=43
|
||||
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
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
||||
@@ -75,13 +75,12 @@ FILE fqName:<root> fileName:/membersImportedFromObject.kt
|
||||
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:public [final,static] ' type=kotlin.Int origin=null
|
||||
PROPERTY name:test4 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun <get-barExt> (): IrErrorType declared in <root>.A' type=IrErrorType origin=null
|
||||
CALL 'public final fun <get-barExt> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
|
||||
$this: CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
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> (): IrErrorType declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
|
||||
|
||||
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:public [final,static] ' type=kotlin.Int origin=null
|
||||
|
||||
@@ -12,10 +12,10 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: T>#' type=IrErrorType
|
||||
PROPERTY name:classRefExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-classRefExtVal> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
FUN name:<get-classRefExtVal> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KClass<IrErrorType>
|
||||
correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefExtVal> (): IrErrorType declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefExtVal> (): kotlin.reflect.KClass<IrErrorType> declared in <root>'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: T>#' type=IrErrorType
|
||||
CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
@@ -39,11 +39,11 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: TF>#' type=IrErrorType
|
||||
PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-classRefGenericMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:IrErrorType
|
||||
FUN name:<get-classRefGenericMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.reflect.KClass<IrErrorType>
|
||||
correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefGenericMemberExtVal> (): IrErrorType declared in <root>.Host'
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefGenericMemberExtVal> (): kotlin.reflect.KClass<IrErrorType> declared in <root>.Host'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: TV>#' type=IrErrorType
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
|
||||
Reference in New Issue
Block a user