PSI2IR: Fix delegated members generation
When generating bodies for members implemented by delegation, invoke corresponding delegate member, not an interface member. Otherwise we might lose platform-specific nullability information in case of mixed Kotlin-Java hierarchies, as in implicitNotNullOnDelegatedImplementation.kt
This commit is contained in:
+5
@@ -126,6 +126,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt");
|
runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("implicitNotNullOnDelegatedImplementation.kt")
|
||||||
|
public void testImplicitNotNullOnDelegatedImplementation() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("initBlock.kt")
|
@TestMetadata("initBlock.kt")
|
||||||
public void testInitBlock() throws Exception {
|
public void testInitBlock() throws Exception {
|
||||||
runTest("compiler/testData/ir/irText/classes/initBlock.kt");
|
runTest("compiler/testData/ir/irText/classes/initBlock.kt");
|
||||||
|
|||||||
+80
-72
@@ -41,6 +41,7 @@ import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
|||||||
import org.jetbrains.kotlin.renderer.DescriptorRendererModifier
|
import org.jetbrains.kotlin.renderer.DescriptorRendererModifier
|
||||||
import org.jetbrains.kotlin.renderer.OverrideRenderingPolicy
|
import org.jetbrains.kotlin.renderer.OverrideRenderingPolicy
|
||||||
import org.jetbrains.kotlin.resolve.BindingContext
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
|
import org.jetbrains.kotlin.resolve.DelegationResolver
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.propertyIfAccessor
|
import org.jetbrains.kotlin.resolve.descriptorUtil.propertyIfAccessor
|
||||||
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||||
@@ -142,8 +143,8 @@ class ClassGenerator(
|
|||||||
private fun generateFakeOverrideMemberDeclarations(irClass: IrClass, ktClassOrObject: KtPureClassOrObject) {
|
private fun generateFakeOverrideMemberDeclarations(irClass: IrClass, ktClassOrObject: KtPureClassOrObject) {
|
||||||
irClass.descriptor.unsubstitutedMemberScope.getContributedDescriptors()
|
irClass.descriptor.unsubstitutedMemberScope.getContributedDescriptors()
|
||||||
.mapNotNull {
|
.mapNotNull {
|
||||||
it.safeAs<CallableMemberDescriptor>().takeIf {
|
it.safeAs<CallableMemberDescriptor>().takeIf { memberDescriptor ->
|
||||||
it?.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE
|
memberDescriptor?.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sortedByRenderer()
|
.sortedByRenderer()
|
||||||
@@ -154,31 +155,25 @@ class ClassGenerator(
|
|||||||
|
|
||||||
private fun generateMembersDeclaredInSupertypeList(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
private fun generateMembersDeclaredInSupertypeList(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
||||||
val ktSuperTypeList = ktClassOrObject.getSuperTypeList() ?: return
|
val ktSuperTypeList = ktClassOrObject.getSuperTypeList() ?: return
|
||||||
val delegatedMembers = irClass.descriptor.unsubstitutedMemberScope
|
|
||||||
.getContributedDescriptors(DescriptorKindFilter.CALLABLES)
|
|
||||||
.filterIsInstance<CallableMemberDescriptor>()
|
|
||||||
.filter { it.kind == CallableMemberDescriptor.Kind.DELEGATION }
|
|
||||||
.sortedByRenderer()
|
|
||||||
if (delegatedMembers.isEmpty()) return
|
|
||||||
|
|
||||||
for (ktEntry in ktSuperTypeList.entries) {
|
for (ktEntry in ktSuperTypeList.entries) {
|
||||||
if (ktEntry is KtDelegatedSuperTypeEntry) {
|
if (ktEntry is KtDelegatedSuperTypeEntry) {
|
||||||
generateDelegatedImplementationMembers(irClass, ktEntry, delegatedMembers)
|
generateDelegatedImplementationMembers(irClass, ktEntry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateDelegatedImplementationMembers(
|
private fun generateDelegatedImplementationMembers(
|
||||||
irClass: IrClass,
|
irClass: IrClass,
|
||||||
ktEntry: KtDelegatedSuperTypeEntry,
|
ktEntry: KtDelegatedSuperTypeEntry
|
||||||
delegatedMembers: List<CallableMemberDescriptor>
|
|
||||||
) {
|
) {
|
||||||
val ktDelegateExpression = ktEntry.delegateExpression!!
|
val ktDelegateExpression = ktEntry.delegateExpression!!
|
||||||
val delegateType = getTypeInferredByFrontendOrFail(ktDelegateExpression)
|
val delegateType = getTypeInferredByFrontendOrFail(ktDelegateExpression)
|
||||||
val superType = getOrFail(BindingContext.TYPE, ktEntry.typeReference!!)
|
val superType = getOrFail(BindingContext.TYPE, ktEntry.typeReference!!)
|
||||||
|
|
||||||
val superTypeConstructorDescriptor = superType.constructor.declarationDescriptor
|
val superTypeConstructorDescriptor = superType.constructor.declarationDescriptor
|
||||||
val superClass = superTypeConstructorDescriptor as? ClassDescriptor
|
val superClass = superTypeConstructorDescriptor as? ClassDescriptor
|
||||||
?: throw AssertionError("Unexpected supertype constructor for delegation: $superTypeConstructorDescriptor")
|
?: throw AssertionError("Unexpected supertype constructor for delegation: $superTypeConstructorDescriptor")
|
||||||
|
|
||||||
val delegateDescriptor = IrImplementingDelegateDescriptorImpl(irClass.descriptor, delegateType, superType)
|
val delegateDescriptor = IrImplementingDelegateDescriptorImpl(irClass.descriptor, delegateType, superType)
|
||||||
val irDelegateField = context.symbolTable.declareField(
|
val irDelegateField = context.symbolTable.declareField(
|
||||||
ktDelegateExpression.startOffsetSkippingComments, ktDelegateExpression.endOffset,
|
ktDelegateExpression.startOffsetSkippingComments, ktDelegateExpression.endOffset,
|
||||||
@@ -188,10 +183,17 @@ class ClassGenerator(
|
|||||||
)
|
)
|
||||||
irClass.addMember(irDelegateField)
|
irClass.addMember(irDelegateField)
|
||||||
|
|
||||||
|
val delegatesMap = DelegationResolver.getDelegates(irClass.descriptor, superClass, delegateType)
|
||||||
|
val delegatedMembers = delegatesMap.keys.toList().sortedByRenderer()
|
||||||
|
|
||||||
for (delegatedMember in delegatedMembers) {
|
for (delegatedMember in delegatedMembers) {
|
||||||
val overriddenMember = delegatedMember.overriddenDescriptors.find { it.containingDeclaration.original == superClass.original }
|
val overriddenMember = delegatedMember.overriddenDescriptors.find { it.containingDeclaration.original == superClass.original }
|
||||||
if (overriddenMember != null) {
|
if (overriddenMember != null) {
|
||||||
generateDelegatedMember(irClass, irDelegateField, delegatedMember, overriddenMember)
|
val delegateToMember = delegatesMap[delegatedMember]
|
||||||
|
?: throw AssertionError(
|
||||||
|
"No corresponding member in delegate type $delegateType for $delegatedMember overriding $overriddenMember"
|
||||||
|
)
|
||||||
|
generateDelegatedMember(irClass, irDelegateField, delegatedMember, delegateToMember)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,30 +202,27 @@ class ClassGenerator(
|
|||||||
irClass: IrClass,
|
irClass: IrClass,
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegatedMember: CallableMemberDescriptor,
|
delegatedMember: CallableMemberDescriptor,
|
||||||
overriddenMember: CallableMemberDescriptor
|
delegateToMember: CallableMemberDescriptor
|
||||||
) {
|
) {
|
||||||
when (delegatedMember) {
|
when (delegatedMember) {
|
||||||
is FunctionDescriptor ->
|
is FunctionDescriptor -> generateDelegatedFunction(irClass, irDelegate, delegatedMember, delegateToMember as FunctionDescriptor)
|
||||||
generateDelegatedFunction(irClass, irDelegate, delegatedMember, overriddenMember as FunctionDescriptor)
|
is PropertyDescriptor -> generateDelegatedProperty(irClass, irDelegate, delegatedMember, delegateToMember as PropertyDescriptor)
|
||||||
is PropertyDescriptor ->
|
|
||||||
generateDelegatedProperty(irClass, irDelegate, delegatedMember, overriddenMember as PropertyDescriptor)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateDelegatedProperty(
|
private fun generateDelegatedProperty(
|
||||||
irClass: IrClass,
|
irClass: IrClass,
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegated: PropertyDescriptor,
|
delegatedDescriptor: PropertyDescriptor,
|
||||||
overridden: PropertyDescriptor
|
delegateToDescriptor: PropertyDescriptor
|
||||||
) {
|
) {
|
||||||
irClass.addMember(generateDelegatedProperty(irDelegate, delegated, overridden))
|
irClass.addMember(generateDelegatedProperty(irDelegate, delegatedDescriptor, delegateToDescriptor))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateDelegatedProperty(
|
private fun generateDelegatedProperty(
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegatedDescriptor: PropertyDescriptor,
|
delegatedDescriptor: PropertyDescriptor,
|
||||||
overriddenDescriptor: PropertyDescriptor
|
delegateToDescriptor: PropertyDescriptor
|
||||||
): IrProperty {
|
): IrProperty {
|
||||||
val startOffset = irDelegate.startOffset
|
val startOffset = irDelegate.startOffset
|
||||||
val endOffset = irDelegate.endOffset
|
val endOffset = irDelegate.endOffset
|
||||||
@@ -233,10 +232,10 @@ class ClassGenerator(
|
|||||||
delegatedDescriptor
|
delegatedDescriptor
|
||||||
)
|
)
|
||||||
|
|
||||||
irProperty.getter = generateDelegatedFunction(irDelegate, delegatedDescriptor.getter!!, overriddenDescriptor.getter!!)
|
irProperty.getter = generateDelegatedFunction(irDelegate, delegatedDescriptor.getter!!, delegateToDescriptor.getter!!)
|
||||||
|
|
||||||
if (delegatedDescriptor.isVar) {
|
if (delegatedDescriptor.isVar) {
|
||||||
irProperty.setter = generateDelegatedFunction(irDelegate, delegatedDescriptor.setter!!, overriddenDescriptor.setter!!)
|
irProperty.setter = generateDelegatedFunction(irDelegate, delegatedDescriptor.setter!!, delegateToDescriptor.setter!!)
|
||||||
}
|
}
|
||||||
return irProperty
|
return irProperty
|
||||||
}
|
}
|
||||||
@@ -244,74 +243,82 @@ class ClassGenerator(
|
|||||||
private fun generateDelegatedFunction(
|
private fun generateDelegatedFunction(
|
||||||
irClass: IrClass,
|
irClass: IrClass,
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegated: FunctionDescriptor,
|
delegatedDescriptor: FunctionDescriptor,
|
||||||
overridden: FunctionDescriptor
|
delegateToDescriptor: FunctionDescriptor
|
||||||
) {
|
) {
|
||||||
irClass.addMember(generateDelegatedFunction(irDelegate, delegated, overridden))
|
irClass.addMember(generateDelegatedFunction(irDelegate, delegatedDescriptor, delegateToDescriptor))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateDelegatedFunction(
|
private fun generateDelegatedFunction(
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegated: FunctionDescriptor,
|
delegatedDescriptor: FunctionDescriptor,
|
||||||
overridden: FunctionDescriptor
|
delegateToDescriptor: FunctionDescriptor
|
||||||
): IrSimpleFunction =
|
): IrSimpleFunction =
|
||||||
context.symbolTable.declareSimpleFunctionWithOverrides(
|
context.symbolTable.declareSimpleFunctionWithOverrides(
|
||||||
irDelegate.startOffset, irDelegate.endOffset,
|
irDelegate.startOffset, irDelegate.endOffset,
|
||||||
IrDeclarationOrigin.DELEGATED_MEMBER,
|
IrDeclarationOrigin.DELEGATED_MEMBER,
|
||||||
delegated
|
delegatedDescriptor
|
||||||
).buildWithScope { irFunction ->
|
).buildWithScope { irFunction ->
|
||||||
FunctionGenerator(declarationGenerator).generateSyntheticFunctionParameterDeclarations(irFunction)
|
FunctionGenerator(declarationGenerator).generateSyntheticFunctionParameterDeclarations(irFunction)
|
||||||
|
|
||||||
// TODO could possibly refer to scoped type parameters for property accessors
|
// TODO could possibly refer to scoped type parameters for property accessors
|
||||||
irFunction.returnType = delegated.returnType!!.toIrType()
|
irFunction.returnType = delegatedDescriptor.returnType!!.toIrType()
|
||||||
|
|
||||||
irFunction.body = generateDelegateFunctionBody(irDelegate, delegated, overridden, irFunction)
|
irFunction.body = generateDelegateFunctionBody(irDelegate, delegatedDescriptor, delegateToDescriptor, irFunction)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateDelegateFunctionBody(
|
private fun generateDelegateFunctionBody(
|
||||||
irDelegate: IrField,
|
irDelegate: IrField,
|
||||||
delegated: FunctionDescriptor,
|
delegatedDescriptor: FunctionDescriptor,
|
||||||
overridden: FunctionDescriptor,
|
delegateToDescriptor: FunctionDescriptor,
|
||||||
irDelegatedFunction: IrSimpleFunction
|
irDelegatedFunction: IrSimpleFunction
|
||||||
): IrBlockBodyImpl {
|
): IrBlockBodyImpl {
|
||||||
val startOffset = irDelegate.startOffset
|
val startOffset = irDelegate.startOffset
|
||||||
val endOffset = irDelegate.endOffset
|
val endOffset = irDelegate.endOffset
|
||||||
|
|
||||||
val irBlockBody = IrBlockBodyImpl(startOffset, endOffset)
|
val irBlockBody = IrBlockBodyImpl(startOffset, endOffset)
|
||||||
val substitutedOverridden = substituteOverriddenDescriptorForDelegate(delegated, overridden)
|
|
||||||
val returnType = substitutedOverridden.returnType!!
|
val substitutedDelegateTo = substituteDelegateToDescriptor(delegatedDescriptor, delegateToDescriptor)
|
||||||
val irReturnType = returnType.toIrType()
|
val returnType = substitutedDelegateTo.returnType!!
|
||||||
val originalSymbol = context.symbolTable.referenceFunction(overridden.original)
|
|
||||||
|
val delegateToSymbol = context.symbolTable.referenceFunction(delegateToDescriptor.original)
|
||||||
|
|
||||||
val irCall = IrCallImpl(
|
val irCall = IrCallImpl(
|
||||||
startOffset, endOffset, irReturnType,
|
startOffset, endOffset,
|
||||||
originalSymbol,
|
returnType.toIrType(),
|
||||||
substitutedOverridden.typeParametersCount
|
delegateToSymbol,
|
||||||
|
substitutedDelegateTo.typeParametersCount
|
||||||
).apply {
|
).apply {
|
||||||
context.callToSubstitutedDescriptorMap[this] = substitutedOverridden
|
context.callToSubstitutedDescriptorMap[this] = substitutedDelegateTo
|
||||||
val typeArguments = getTypeArgumentsForOverriddenDescriptorDelegatingCall(delegated, overridden)
|
|
||||||
|
val typeArguments = getTypeArgumentsForOverriddenDescriptorDelegatingCall(delegatedDescriptor, delegateToDescriptor)
|
||||||
putTypeArguments(typeArguments) { it.toIrType() }
|
putTypeArguments(typeArguments) { it.toIrType() }
|
||||||
}
|
|
||||||
val dispatchReceiverParameter = irDelegatedFunction.dispatchReceiverParameter!!
|
val dispatchReceiverParameter = irDelegatedFunction.dispatchReceiverParameter!!
|
||||||
val dispatchReceiverType = dispatchReceiverParameter.type
|
dispatchReceiver =
|
||||||
irCall.dispatchReceiver =
|
IrGetFieldImpl(
|
||||||
IrGetFieldImpl(
|
|
||||||
startOffset, endOffset,
|
|
||||||
irDelegate.symbol,
|
|
||||||
irDelegate.type,
|
|
||||||
IrGetValueImpl(
|
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
dispatchReceiverType,
|
irDelegate.symbol,
|
||||||
dispatchReceiverParameter.symbol
|
irDelegate.type,
|
||||||
|
IrGetValueImpl(
|
||||||
|
startOffset, endOffset,
|
||||||
|
dispatchReceiverParameter.type,
|
||||||
|
dispatchReceiverParameter.symbol
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
irCall.extensionReceiver =
|
extensionReceiver =
|
||||||
irDelegatedFunction.extensionReceiverParameter?.let { extensionReceiver ->
|
irDelegatedFunction.extensionReceiverParameter?.let { extensionReceiver ->
|
||||||
IrGetValueImpl(startOffset, endOffset, extensionReceiver.type, extensionReceiver.symbol)
|
IrGetValueImpl(startOffset, endOffset, extensionReceiver.type, extensionReceiver.symbol)
|
||||||
|
}
|
||||||
|
|
||||||
|
mapValueParameters { overriddenValueParameter ->
|
||||||
|
val delegatedValueParameter = delegatedDescriptor.valueParameters[overriddenValueParameter.index]
|
||||||
|
val irDelegatedValueParameter = irDelegatedFunction.getIrValueParameter(delegatedValueParameter)
|
||||||
|
IrGetValueImpl(startOffset, endOffset, irDelegatedValueParameter.type, irDelegatedValueParameter.symbol)
|
||||||
}
|
}
|
||||||
irCall.mapValueParameters { overriddenValueParameter ->
|
|
||||||
val delegatedValueParameter = delegated.valueParameters[overriddenValueParameter.index]
|
|
||||||
val irDelegatedValueParameter = irDelegatedFunction.getIrValueParameter(delegatedValueParameter)
|
|
||||||
IrGetValueImpl(startOffset, endOffset, irDelegatedValueParameter.type, irDelegatedValueParameter.symbol)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KotlinBuiltIns.isUnit(returnType) || KotlinBuiltIns.isNothing(returnType)) {
|
if (KotlinBuiltIns.isUnit(returnType) || KotlinBuiltIns.isNothing(returnType)) {
|
||||||
irBlockBody.statements.add(irCall)
|
irBlockBody.statements.add(irCall)
|
||||||
} else {
|
} else {
|
||||||
@@ -322,22 +329,23 @@ class ClassGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
private fun <D : CallableMemberDescriptor> substituteOverriddenDescriptorForDelegate(delegated: D, overridden: D): D =
|
private fun <D : CallableMemberDescriptor> substituteDelegateToDescriptor(delegated: D, overridden: D): D =
|
||||||
// PropertyAccessorDescriptor doesn't support 'substitute' right now, so we substitute the corresponding property instead.
|
// PropertyAccessorDescriptor doesn't support 'substitute', so we substitute the corresponding property instead.
|
||||||
when (overridden) {
|
when (overridden) {
|
||||||
is PropertyGetterDescriptor -> substituteOverriddenDescriptorForDelegate(
|
is PropertyGetterDescriptor -> substituteDelegateToDescriptor(
|
||||||
(delegated as PropertyGetterDescriptor).correspondingProperty,
|
(delegated as PropertyGetterDescriptor).correspondingProperty,
|
||||||
overridden.correspondingProperty
|
overridden.correspondingProperty
|
||||||
).getter as D
|
).getter as D
|
||||||
is PropertySetterDescriptor -> substituteOverriddenDescriptorForDelegate(
|
is PropertySetterDescriptor -> substituteDelegateToDescriptor(
|
||||||
(delegated as PropertySetterDescriptor).correspondingProperty,
|
(delegated as PropertySetterDescriptor).correspondingProperty,
|
||||||
overridden.correspondingProperty
|
overridden.correspondingProperty
|
||||||
).setter as D
|
).setter as D
|
||||||
else -> {
|
else -> {
|
||||||
|
val delegatedTypeParameters = delegated.typeParameters
|
||||||
val substitutor =
|
val substitutor =
|
||||||
TypeSubstitutor.create(
|
TypeSubstitutor.create(
|
||||||
overridden.typeParameters.associate {
|
overridden.typeParameters.associate {
|
||||||
val delegatedDefaultType = delegated.typeParameters[it.index].defaultType
|
val delegatedDefaultType = delegatedTypeParameters[it.index].defaultType
|
||||||
it.typeConstructor to TypeProjectionImpl(delegatedDefaultType)
|
it.typeConstructor to TypeProjectionImpl(delegatedDefaultType)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -346,13 +354,13 @@ class ClassGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getTypeArgumentsForOverriddenDescriptorDelegatingCall(
|
private fun getTypeArgumentsForOverriddenDescriptorDelegatingCall(
|
||||||
delegated: FunctionDescriptor,
|
delegatedDescriptor: FunctionDescriptor,
|
||||||
overridden: FunctionDescriptor
|
delegateToDescriptor: FunctionDescriptor
|
||||||
): Map<TypeParameterDescriptor, KotlinType>? {
|
): Map<TypeParameterDescriptor, KotlinType>? {
|
||||||
val keys = overridden.propertyIfAccessor.original.typeParameters
|
val keys = delegateToDescriptor.propertyIfAccessor.original.typeParameters
|
||||||
if (keys.isEmpty()) return null
|
if (keys.isEmpty()) return null
|
||||||
|
|
||||||
val values = delegated.propertyIfAccessor.typeParameters
|
val values = delegatedDescriptor.propertyIfAccessor.typeParameters
|
||||||
|
|
||||||
val typeArguments = newHashMapWithExpectedSize<TypeParameterDescriptor, KotlinType>(keys.size)
|
val typeArguments = newHashMapWithExpectedSize<TypeParameterDescriptor, KotlinType>(keys.size)
|
||||||
for ((i, overriddenTypeParameter) in keys.withIndex()) {
|
for ((i, overriddenTypeParameter) in keys.withIndex()) {
|
||||||
|
|||||||
@@ -1,15 +1,4 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
// FILE: delegation.kt
|
||||||
// FILE: Delegation.java
|
|
||||||
|
|
||||||
public class Delegation {
|
|
||||||
public static class ReturnNull {
|
|
||||||
public String foo() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: 1.kt
|
|
||||||
|
|
||||||
interface Tr {
|
interface Tr {
|
||||||
fun foo(): String
|
fun foo(): String
|
||||||
@@ -19,8 +8,7 @@ class DelegateTo : Delegation.ReturnNull(), Tr {
|
|||||||
override fun foo() = super<Delegation.ReturnNull>.foo()
|
override fun foo() = super<Delegation.ReturnNull>.foo()
|
||||||
}
|
}
|
||||||
|
|
||||||
class DelegateFrom : Tr by DelegateTo() {
|
class DelegateFrom : Tr by DelegateTo()
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
try {
|
try {
|
||||||
@@ -31,3 +19,13 @@ fun box(): String {
|
|||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FILE: Delegation.java
|
||||||
|
|
||||||
|
public class Delegation {
|
||||||
|
public static class ReturnNull {
|
||||||
|
public String foo() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
|
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test1'
|
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test1'
|
||||||
CALL 'public abstract fun bar (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
|
CALL 'public open fun bar (): kotlin.Int declared in <root>.BaseImpl' type=kotlin.Int origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.bar' type=<root>.Test1 origin=null
|
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.bar' type=<root>.Test1 origin=null
|
||||||
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
|
||||||
@@ -219,7 +219,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||||
VALUE_PARAMETER name:s index:1 type:kotlin.String
|
VALUE_PARAMETER name:s index:1 type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
CALL 'public open fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.BaseImpl' type=kotlin.Unit origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.foo' type=<root>.Test1 origin=null
|
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.foo' type=<root>.Test1 origin=null
|
||||||
x: GET_VAR 'x: kotlin.Int declared in <root>.Test1.foo' type=kotlin.Int origin=null
|
x: GET_VAR 'x: kotlin.Int declared in <root>.Test1.foo' type=kotlin.Int origin=null
|
||||||
@@ -230,7 +230,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
|
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
|
||||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun qux (): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
CALL 'public open fun qux (): kotlin.Unit declared in <root>.BaseImpl' type=kotlin.Unit origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test1$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.qux' type=<root>.Test1 origin=null
|
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.qux' type=<root>.Test1 origin=null
|
||||||
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.Test1.qux' type=kotlin.String origin=null
|
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.Test1.qux' type=kotlin.String origin=null
|
||||||
@@ -262,7 +262,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
|
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test2'
|
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test2'
|
||||||
CALL 'public abstract fun bar (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
|
CALL 'public open fun bar (): kotlin.Int declared in <root>.BaseImpl' type=kotlin.Int origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.bar' type=<root>.Test2 origin=null
|
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.bar' type=<root>.Test2 origin=null
|
||||||
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
|
||||||
@@ -272,7 +272,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||||
VALUE_PARAMETER name:s index:1 type:kotlin.String
|
VALUE_PARAMETER name:s index:1 type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
CALL 'public open fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.BaseImpl' type=kotlin.Unit origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.foo' type=<root>.Test2 origin=null
|
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.foo' type=<root>.Test2 origin=null
|
||||||
x: GET_VAR 'x: kotlin.Int declared in <root>.Test2.foo' type=kotlin.Int origin=null
|
x: GET_VAR 'x: kotlin.Int declared in <root>.Test2.foo' type=kotlin.Int origin=null
|
||||||
@@ -283,7 +283,7 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
|
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
|
||||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun qux (): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
CALL 'public open fun qux (): kotlin.Unit declared in <root>.BaseImpl' type=kotlin.Unit origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:Test2$IBase$delegate type:<root>.BaseImpl visibility:private [final]' type=<root>.BaseImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.qux' type=<root>.Test2 origin=null
|
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.qux' type=<root>.Test2 origin=null
|
||||||
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.Test2.qux' type=kotlin.String origin=null
|
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.Test2.qux' type=kotlin.String origin=null
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ FILE fqName:<root> fileName:/delegatedImplementationWithExplicitOverride.kt
|
|||||||
public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar
|
public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar' type=kotlin.Unit origin=null
|
CALL 'public open fun foo (): kotlin.Unit declared in <root>.FooBarImpl' type=kotlin.Unit origin=null
|
||||||
$this: GET_FIELD 'FIELD DELEGATE name:C$IFooBar$delegate type:<root>.FooBarImpl visibility:private [final]' type=<root>.FooBarImpl origin=null
|
$this: GET_FIELD 'FIELD DELEGATE name:C$IFooBar$delegate type:<root>.FooBarImpl visibility:private [final]' type=<root>.FooBarImpl origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.foo' type=<root>.C origin=null
|
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.foo' type=<root>.C origin=null
|
||||||
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.Unit
|
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.Unit
|
||||||
|
|||||||
+229
@@ -0,0 +1,229 @@
|
|||||||
|
FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
|
||||||
|
CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IFoo
|
||||||
|
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[<root>.JFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K1
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K1 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[<root>.JFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.JFoo) returnType:kotlin.String [fake_override,operator]
|
||||||
|
overridden:
|
||||||
|
public open fun foo (): kotlin.String [operator] declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.JFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[<root>.JFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K2
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K2 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[<root>.JFoo]'
|
||||||
|
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K2) returnType:kotlin.String
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.K2
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.K2'
|
||||||
|
CALL 'public open fun foo (): kotlin.String [operator] declared in <root>.JFoo' type=kotlin.String origin=null
|
||||||
|
$this: ERROR_CALL 'Unresolved reference: super<R|JFoo|>' type=<root>.JFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K3
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K3 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K4
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K4 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
||||||
|
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:kotlin.String?
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.K4
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String? declared in <root>.K4'
|
||||||
|
CALL 'public open fun foo (): kotlin.String? [operator] declared in <root>.JUnrelatedFoo' type=kotlin.String? origin=null
|
||||||
|
$this: ERROR_CALL 'Unresolved reference: super<R|JUnrelatedFoo|>' type=<root>.JUnrelatedFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestJFoo
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestJFoo [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK1
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK1 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK2
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK2 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK3
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK3 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK4
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK4 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
// FILE: implicitNotNullOnDelegatedImplementation.kt
|
||||||
|
interface IFoo {
|
||||||
|
fun foo(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
class K1 : JFoo()
|
||||||
|
|
||||||
|
class K2 : JFoo() {
|
||||||
|
override fun foo() = super.foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
class K3 : JUnrelatedFoo(), IFoo
|
||||||
|
|
||||||
|
class K4 : JUnrelatedFoo(), IFoo {
|
||||||
|
override fun foo() = super.foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestJFoo : IFoo by JFoo() {
|
||||||
|
// nullability assertion in 'foo()'
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestK1 : IFoo by K1() {
|
||||||
|
// nullability assertion in 'foo()'
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestK2 : IFoo by K2() {
|
||||||
|
// no nullability assertion in 'foo()'
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestK3 : IFoo by K3() {
|
||||||
|
// no nullability assertion in 'foo()'
|
||||||
|
}
|
||||||
|
|
||||||
|
class TestK4 : IFoo by K4() {
|
||||||
|
// nullability assertion in 'foo()'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: JFoo.java
|
||||||
|
public class JFoo implements IFoo {
|
||||||
|
public String foo() { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: JUnrelatedFoo.java
|
||||||
|
public class JUnrelatedFoo {
|
||||||
|
public String foo() { return null; }
|
||||||
|
}
|
||||||
+285
@@ -0,0 +1,285 @@
|
|||||||
|
FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
|
||||||
|
CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IFoo
|
||||||
|
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
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
|
||||||
|
CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[<root>.JFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K1
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K1 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[<root>.JFoo]'
|
||||||
|
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 [fake_override,operator] declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.JFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public open fun foo (): kotlin.String declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.JFoo
|
||||||
|
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||||
|
overridden:
|
||||||
|
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.JFoo
|
||||||
|
$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 [fake_override] declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[<root>.JFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K2
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K2 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[<root>.JFoo]'
|
||||||
|
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.K2) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public open fun foo (): kotlin.String declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.K2
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.K2'
|
||||||
|
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||||
|
CALL 'public open fun foo (): kotlin.String declared in <root>.JFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JFoo modality:OPEN visibility:public superTypes:[<root>.IFoo]' type=kotlin.String origin=null
|
||||||
|
$this: GET_VAR '<this>: <root>.K2 declared in <root>.K2.foo' type=<root>.K2 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.JFoo
|
||||||
|
$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 [fake_override] declared in <root>.JFoo
|
||||||
|
$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 [fake_override] declared in <root>.JFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K3
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K3 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
||||||
|
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 [fake_override,operator] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||||
|
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
|
||||||
|
overridden:
|
||||||
|
public open fun foo (): kotlin.String? declared in <root>.JUnrelatedFoo
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
|
||||||
|
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||||
|
overridden:
|
||||||
|
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K4
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.K4 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
||||||
|
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.K4) returnType:kotlin.String?
|
||||||
|
overridden:
|
||||||
|
public open fun foo (): kotlin.String? declared in <root>.JUnrelatedFoo
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.K4
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String? declared in <root>.K4'
|
||||||
|
CALL 'public open fun foo (): kotlin.String? declared in <root>.JUnrelatedFoo' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:JUnrelatedFoo modality:OPEN visibility:public superTypes:[kotlin.Any]' type=kotlin.String? origin=null
|
||||||
|
$this: GET_VAR '<this>: <root>.K4 declared in <root>.K4.foo' type=<root>.K4 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.JUnrelatedFoo
|
||||||
|
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestJFoo
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestJFoo [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FIELD DELEGATE name:TestJFoo$IFoo$delegate type:<root>.JFoo visibility:private [final]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo' type=<root>.JFoo origin=null
|
||||||
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestJFoo) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.TestJFoo
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestJFoo'
|
||||||
|
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||||
|
CALL 'public open fun foo (): kotlin.String declared in <root>.JFoo' type=kotlin.String origin=null
|
||||||
|
$this: GET_FIELD 'FIELD DELEGATE name:TestJFoo$IFoo$delegate type:<root>.JFoo visibility:private [final]' type=<root>.JFoo origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.TestJFoo declared in <root>.TestJFoo.foo' type=<root>.TestJFoo origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK1
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK1 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FIELD DELEGATE name:TestK1$IFoo$delegate type:<root>.K1 visibility:private [final]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K1' type=<root>.K1 origin=null
|
||||||
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK1) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.TestK1
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK1'
|
||||||
|
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||||
|
CALL 'public open fun foo (): kotlin.String [fake_override] declared in <root>.K1' type=kotlin.String origin=null
|
||||||
|
$this: GET_FIELD 'FIELD DELEGATE name:TestK1$IFoo$delegate type:<root>.K1 visibility:private [final]' type=<root>.K1 origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.TestK1 declared in <root>.TestK1.foo' type=<root>.TestK1 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK2
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK2 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FIELD DELEGATE name:TestK2$IFoo$delegate type:<root>.K2 visibility:private [final]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K2' type=<root>.K2 origin=null
|
||||||
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK2) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.TestK2
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK2'
|
||||||
|
CALL 'public open fun foo (): kotlin.String declared in <root>.K2' type=kotlin.String origin=null
|
||||||
|
$this: GET_FIELD 'FIELD DELEGATE name:TestK2$IFoo$delegate type:<root>.K2 visibility:private [final]' type=<root>.K2 origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.TestK2 declared in <root>.TestK2.foo' type=<root>.TestK2 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK3
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK3 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FIELD DELEGATE name:TestK3$IFoo$delegate type:<root>.K3 visibility:private [final]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K3' type=<root>.K3 origin=null
|
||||||
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK3) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.TestK3
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK3'
|
||||||
|
CALL 'public open fun foo (): kotlin.String [fake_override] declared in <root>.K3' type=kotlin.String origin=null
|
||||||
|
$this: GET_FIELD 'FIELD DELEGATE name:TestK3$IFoo$delegate type:<root>.K3 visibility:private [final]' type=<root>.K3 origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.TestK3 declared in <root>.TestK3.foo' type=<root>.TestK3 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
|
CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[<root>.IFoo]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestK4
|
||||||
|
CONSTRUCTOR visibility:public <> () returnType:<root>.TestK4 [primary]
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
|
||||||
|
FIELD DELEGATE name:TestK4$IFoo$delegate type:<root>.K4 visibility:private [final]
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K4' type=<root>.K4 origin=null
|
||||||
|
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK4) returnType:kotlin.String
|
||||||
|
overridden:
|
||||||
|
public abstract fun foo (): kotlin.String declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:<root>.TestK4
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK4'
|
||||||
|
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||||
|
CALL 'public open fun foo (): kotlin.String? declared in <root>.K4' type=kotlin.String? origin=null
|
||||||
|
$this: GET_FIELD 'FIELD DELEGATE name:TestK4$IFoo$delegate type:<root>.K4 visibility:private [final]' type=<root>.K4 origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.TestK4 declared in <root>.TestK4.foo' type=<root>.TestK4 origin=null
|
||||||
|
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 [fake_override,operator] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$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 [fake_override] declared in <root>.IFoo
|
||||||
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
@@ -125,6 +125,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
|||||||
runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt");
|
runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("implicitNotNullOnDelegatedImplementation.kt")
|
||||||
|
public void testImplicitNotNullOnDelegatedImplementation() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("initBlock.kt")
|
@TestMetadata("initBlock.kt")
|
||||||
public void testInitBlock() throws Exception {
|
public void testInitBlock() throws Exception {
|
||||||
runTest("compiler/testData/ir/irText/classes/initBlock.kt");
|
runTest("compiler/testData/ir/irText/classes/initBlock.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user