KT-47939 fun interface constructor reference should throw NPE for null
This commit is contained in:
committed by
TeamCityServer
parent
e5eee9bab9
commit
0ccd7a7e0c
+10
-6
@@ -501,7 +501,7 @@ internal class AdapterGenerator(
|
|||||||
callableReference.convertWithOffsets { startOffset: Int, endOffset: Int ->
|
callableReference.convertWithOffsets { startOffset: Int, endOffset: Int ->
|
||||||
// {
|
// {
|
||||||
// fun <ADAPTER_FUN>(function: <FUN_TYPE>): <FUN_INTERFACE_TYPE> =
|
// fun <ADAPTER_FUN>(function: <FUN_TYPE>): <FUN_INTERFACE_TYPE> =
|
||||||
// <FUN_INTERFACE_TYPE>(function)
|
// <FUN_INTERFACE_TYPE>(function!!)
|
||||||
// ::<ADAPTER_FUN>
|
// ::<ADAPTER_FUN>
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -581,12 +581,16 @@ internal class AdapterGenerator(
|
|||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
listOf(
|
listOf(
|
||||||
IrReturnImpl(
|
IrReturnImpl(
|
||||||
startOffset, endOffset, components.irBuiltIns.nothingType,
|
startOffset, endOffset, components.irBuiltIns.nothingType, irAdapterFunction.symbol,
|
||||||
irAdapterFunction.symbol,
|
|
||||||
IrTypeOperatorCallImpl(
|
IrTypeOperatorCallImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset, irSamType, IrTypeOperator.SAM_CONVERSION, irSamType,
|
||||||
irSamType, IrTypeOperator.SAM_CONVERSION, irSamType,
|
IrCallImpl(
|
||||||
IrGetValueImpl(startOffset, endOffset, irFunctionParameter.symbol)
|
startOffset, endOffset, irFunctionType, irBuiltIns.checkNotNullSymbol,
|
||||||
|
typeArgumentsCount = 1, valueArgumentsCount = 1, origin = IrStatementOrigin.EXCLEXCL
|
||||||
|
).apply {
|
||||||
|
putTypeArgument(0, irFunctionType)
|
||||||
|
putValueArgument(0, IrGetValueImpl(startOffset, endOffset, irFunctionParameter.symbol))
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
+6
@@ -3602,6 +3602,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
public void testFunInterfaceConstructorEquality() throws Exception {
|
public void testFunInterfaceConstructorEquality() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorEquality.kt");
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorEquality.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("funInterfaceConstructorThrowsNpe.kt")
|
||||||
|
public void testFunInterfaceConstructorThrowsNpe() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorThrowsNpe.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+35
-15
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.builtins.*
|
|||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.synthetic.FunctionInterfaceConstructorDescriptor
|
import org.jetbrains.kotlin.descriptors.synthetic.FunctionInterfaceConstructorDescriptor
|
||||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||||
|
import org.jetbrains.kotlin.ir.builders.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.DescriptorMetadataSource
|
import org.jetbrains.kotlin.ir.declarations.DescriptorMetadataSource
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||||
@@ -43,6 +44,8 @@ import org.jetbrains.kotlin.resolve.ImportedFromObjectCallableDescriptor
|
|||||||
import org.jetbrains.kotlin.resolve.calls.model.*
|
import org.jetbrains.kotlin.resolve.calls.model.*
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver
|
import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
|
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
||||||
|
import org.jetbrains.kotlin.types.TypeSubstitutor
|
||||||
import org.jetbrains.kotlin.types.expressions.DoubleColonLHS
|
import org.jetbrains.kotlin.types.expressions.DoubleColonLHS
|
||||||
|
|
||||||
class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : StatementGeneratorExtension(statementGenerator) {
|
class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : StatementGeneratorExtension(statementGenerator) {
|
||||||
@@ -88,7 +91,7 @@ class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : St
|
|||||||
statementGenerator.generateCallReceiver(
|
statementGenerator.generateCallReceiver(
|
||||||
ktCallableReference,
|
ktCallableReference,
|
||||||
resolvedDescriptor,
|
resolvedDescriptor,
|
||||||
resolvedCall.dispatchReceiver, resolvedCall.extensionReceiver,resolvedCall.contextReceivers,
|
resolvedCall.dispatchReceiver, resolvedCall.extensionReceiver, resolvedCall.contextReceivers,
|
||||||
isSafe = false
|
isSafe = false
|
||||||
).call { dispatchReceiverValue, extensionReceiverValue, _ ->
|
).call { dispatchReceiverValue, extensionReceiverValue, _ ->
|
||||||
generateCallableReference(
|
generateCallableReference(
|
||||||
@@ -119,7 +122,7 @@ class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : St
|
|||||||
): IrExpression {
|
): IrExpression {
|
||||||
// {
|
// {
|
||||||
// fun <ADAPTER_FUN>(function: <FUN_TYPE>): <FUN_INTERFACE_TYPE> =
|
// fun <ADAPTER_FUN>(function: <FUN_TYPE>): <FUN_INTERFACE_TYPE> =
|
||||||
// <FUN_INTERFACE_TYPE>(function)
|
// <FUN_INTERFACE_TYPE>(function!!)
|
||||||
// ::<ADAPTER_FUN>
|
// ::<ADAPTER_FUN>
|
||||||
// }
|
// }
|
||||||
val startOffset = ktCallableReference.startOffsetSkippingComments
|
val startOffset = ktCallableReference.startOffsetSkippingComments
|
||||||
@@ -176,23 +179,40 @@ class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : St
|
|||||||
irAdapterFun.dispatchReceiverParameter = null
|
irAdapterFun.dispatchReceiverParameter = null
|
||||||
irAdapterFun.extensionReceiverParameter = null
|
irAdapterFun.extensionReceiverParameter = null
|
||||||
|
|
||||||
val irFnParameter = createAdapterParameter(startOffset, endOffset, functionParameter.name, 0, functionParameter.type)
|
val fnType = functionParameter.type
|
||||||
|
|
||||||
|
val irFnParameter = createAdapterParameter(startOffset, endOffset, functionParameter.name, 0, fnType)
|
||||||
|
val irFnType = irFnParameter.type
|
||||||
|
|
||||||
|
val checkNotNull = context.irBuiltIns.checkNotNullSymbol.descriptor
|
||||||
|
val checkNotNullSubstituted =
|
||||||
|
checkNotNull.substitute(
|
||||||
|
TypeSubstitutor.create(
|
||||||
|
mapOf(checkNotNull.typeParameters[0].typeConstructor to TypeProjectionImpl(fnType))
|
||||||
|
)
|
||||||
|
) ?: throw AssertionError("Substitution failed for $checkNotNull: T=$fnType")
|
||||||
|
|
||||||
irAdapterFun.valueParameters = listOf(irFnParameter)
|
irAdapterFun.valueParameters = listOf(irFnParameter)
|
||||||
irAdapterFun.body =
|
irAdapterFun.body =
|
||||||
context.irFactory.createBlockBody(
|
IrBlockBodyBuilder(
|
||||||
startOffset, endOffset,
|
context,
|
||||||
listOf(
|
Scope(irAdapterFun.symbol),
|
||||||
IrReturnImpl(
|
startOffset,
|
||||||
startOffset, endOffset, context.irBuiltIns.nothingType,
|
endOffset
|
||||||
irAdapterFun.symbol,
|
).blockBody {
|
||||||
IrTypeOperatorCallImpl(
|
+irReturn(
|
||||||
startOffset, endOffset,
|
irSamConversion(
|
||||||
irSamType, IrTypeOperator.SAM_CONVERSION, irSamType,
|
irCall(context.irBuiltIns.checkNotNullSymbol).also { irCall ->
|
||||||
IrGetValueImpl(startOffset, endOffset, irFnParameter.symbol)
|
this@ReflectionReferencesGenerator.context.callToSubstitutedDescriptorMap[irCall] =
|
||||||
)
|
checkNotNullSubstituted
|
||||||
|
irCall.type = irFnType
|
||||||
|
irCall.putTypeArgument(0, irFnType)
|
||||||
|
irCall.putValueArgument(0, irGet(irFnParameter))
|
||||||
|
},
|
||||||
|
irSamType
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,6 +317,9 @@ fun IrBuilderWithScope.irImplicitCast(argument: IrExpression, type: IrType) =
|
|||||||
fun IrBuilderWithScope.irReinterpretCast(argument: IrExpression, type: IrType) =
|
fun IrBuilderWithScope.irReinterpretCast(argument: IrExpression, type: IrType) =
|
||||||
IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.REINTERPRET_CAST, type, argument)
|
IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.REINTERPRET_CAST, type, argument)
|
||||||
|
|
||||||
|
fun IrBuilderWithScope.irSamConversion(argument: IrExpression, type: IrType) =
|
||||||
|
typeOperator(type, argument, IrTypeOperator.SAM_CONVERSION, type)
|
||||||
|
|
||||||
fun IrBuilderWithScope.irInt(value: Int, type: IrType = context.irBuiltIns.intType) =
|
fun IrBuilderWithScope.irInt(value: Int, type: IrType = context.irBuiltIns.intType) =
|
||||||
IrConstImpl.int(startOffset, endOffset, type, value)
|
IrConstImpl.int(startOffset, endOffset, type, value)
|
||||||
|
|
||||||
|
|||||||
+76
-47
@@ -96,9 +96,22 @@ class IrBuiltInsOverDescriptors(
|
|||||||
|
|
||||||
val symbol = symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
val symbol = symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
||||||
val operator = irFactory.createFunction(
|
val operator = irFactory.createFunction(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, Name.identifier(name), DescriptorVisibilities.PUBLIC, Modality.FINAL,
|
UNDEFINED_OFFSET,
|
||||||
returnType, isInline = false, isExternal = false, isTailrec = false, isSuspend = false,
|
UNDEFINED_OFFSET,
|
||||||
isOperator = false, isInfix = false, isExpect = false, isFakeOverride = false
|
BUILTIN_OPERATOR,
|
||||||
|
it,
|
||||||
|
Name.identifier(name),
|
||||||
|
DescriptorVisibilities.PUBLIC,
|
||||||
|
Modality.FINAL,
|
||||||
|
returnType,
|
||||||
|
isInline = false,
|
||||||
|
isExternal = false,
|
||||||
|
isTailrec = false,
|
||||||
|
isSuspend = false,
|
||||||
|
isOperator = false,
|
||||||
|
isInfix = false,
|
||||||
|
isExpect = false,
|
||||||
|
isFakeOverride = false
|
||||||
)
|
)
|
||||||
operator.parent = operatorsPackageFragment
|
operator.parent = operatorsPackageFragment
|
||||||
operatorsPackageFragment.declarations += operator
|
operatorsPackageFragment.declarations += operator
|
||||||
@@ -160,49 +173,53 @@ class IrBuiltInsOverDescriptors(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val typeParameterSymbol = IrTypeParameterSymbolImpl(typeParameterDescriptor)
|
return symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) { operatorSymbol ->
|
||||||
val typeParameter = irFactory.createTypeParameter(
|
val typeParameter = symbolTable.declareGlobalTypeParameter(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, typeParameterSymbol, Name.identifier("T0"), 0, true, Variance.INVARIANT
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
||||||
).apply {
|
BUILTIN_OPERATOR,
|
||||||
superTypes += anyType
|
typeParameterDescriptor
|
||||||
}
|
).apply {
|
||||||
|
superTypes += anyType
|
||||||
|
}
|
||||||
|
val typeParameterSymbol = typeParameter.symbol
|
||||||
|
|
||||||
val returnIrType = IrSimpleTypeBuilder().run {
|
val returnIrType = IrSimpleTypeBuilder().run {
|
||||||
classifier = typeParameterSymbol
|
classifier = typeParameterSymbol
|
||||||
kotlinType = returnKotlinType
|
kotlinType = returnKotlinType
|
||||||
hasQuestionMark = false
|
hasQuestionMark = false
|
||||||
buildSimpleType()
|
buildSimpleType()
|
||||||
}
|
}
|
||||||
|
|
||||||
val valueIrType = IrSimpleTypeBuilder().run {
|
val valueIrType = IrSimpleTypeBuilder().run {
|
||||||
classifier = typeParameterSymbol
|
classifier = typeParameterSymbol
|
||||||
kotlinType = valueKotlinType
|
kotlinType = valueKotlinType
|
||||||
hasQuestionMark = true
|
hasQuestionMark = true
|
||||||
buildSimpleType()
|
buildSimpleType()
|
||||||
}
|
}
|
||||||
|
|
||||||
return symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
irFactory.createFunction(
|
||||||
val operator = irFactory.createFunction(
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR,
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, name, DescriptorVisibilities.PUBLIC, Modality.FINAL, returnIrType,
|
operatorSymbol, name,
|
||||||
|
DescriptorVisibilities.PUBLIC, Modality.FINAL,
|
||||||
|
returnIrType,
|
||||||
isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false, isInfix = false,
|
isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false, isInfix = false,
|
||||||
isExpect = false, isFakeOverride = false
|
isExpect = false, isFakeOverride = false
|
||||||
)
|
).also { operator ->
|
||||||
operator.parent = operatorsPackageFragment
|
operator.parent = operatorsPackageFragment
|
||||||
operatorsPackageFragment.declarations += operator
|
operatorsPackageFragment.declarations += operator
|
||||||
|
|
||||||
val valueParameterSymbol = IrValueParameterSymbolImpl(valueParameterDescriptor)
|
val valueParameterSymbol = IrValueParameterSymbolImpl(valueParameterDescriptor)
|
||||||
val valueParameter = irFactory.createValueParameter(
|
val valueParameter = irFactory.createValueParameter(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, valueParameterSymbol, Name.identifier("arg0"), 0,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, valueParameterSymbol, Name.identifier("arg0"), 0,
|
||||||
valueIrType, null, isCrossinline = false, isNoinline = false, isHidden = false, isAssignable = false
|
valueIrType, null, isCrossinline = false, isNoinline = false, isHidden = false, isAssignable = false
|
||||||
)
|
)
|
||||||
|
|
||||||
valueParameter.parent = operator
|
valueParameter.parent = operator
|
||||||
typeParameter.parent = operator
|
typeParameter.parent = operator
|
||||||
|
|
||||||
operator.valueParameters += valueParameter
|
operator.valueParameters += valueParameter
|
||||||
operator.typeParameters += typeParameter
|
operator.typeParameters += typeParameter
|
||||||
|
}
|
||||||
operator
|
|
||||||
}.symbol
|
}.symbol
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,6 +282,7 @@ class IrBuiltInsOverDescriptors(
|
|||||||
val string = builtIns.stringType
|
val string = builtIns.stringType
|
||||||
override val stringType = string.toIrType()
|
override val stringType = string.toIrType()
|
||||||
override val stringClass = builtIns.string.toIrSymbol()
|
override val stringClass = builtIns.string.toIrSymbol()
|
||||||
|
|
||||||
// TODO: check if correct
|
// TODO: check if correct
|
||||||
override val charSequenceClass = findClass(Name.identifier("CharSequence"), "kotlin")!!
|
override val charSequenceClass = findClass(Name.identifier("CharSequence"), "kotlin")!!
|
||||||
|
|
||||||
@@ -341,7 +359,8 @@ class IrBuiltInsOverDescriptors(
|
|||||||
override val doubleArray = builtIns.getPrimitiveArrayClassDescriptor(PrimitiveType.DOUBLE).toIrSymbol()
|
override val doubleArray = builtIns.getPrimitiveArrayClassDescriptor(PrimitiveType.DOUBLE).toIrSymbol()
|
||||||
override val booleanArray = builtIns.getPrimitiveArrayClassDescriptor(PrimitiveType.BOOLEAN).toIrSymbol()
|
override val booleanArray = builtIns.getPrimitiveArrayClassDescriptor(PrimitiveType.BOOLEAN).toIrSymbol()
|
||||||
|
|
||||||
override val primitiveArraysToPrimitiveTypes = PrimitiveType.values().associate { builtIns.getPrimitiveArrayClassDescriptor(it).toIrSymbol() to it }
|
override val primitiveArraysToPrimitiveTypes =
|
||||||
|
PrimitiveType.values().associate { builtIns.getPrimitiveArrayClassDescriptor(it).toIrSymbol() to it }
|
||||||
override val primitiveTypesToPrimitiveArrays = primitiveArraysToPrimitiveTypes.map { (k, v) -> v to k }.toMap()
|
override val primitiveTypesToPrimitiveArrays = primitiveArraysToPrimitiveTypes.map { (k, v) -> v to k }.toMap()
|
||||||
override val primitiveArrayElementTypes = primitiveArraysToPrimitiveTypes.mapValues { primitiveTypeToIrType[it.value] }
|
override val primitiveArrayElementTypes = primitiveArraysToPrimitiveTypes.mapValues { primitiveTypeToIrType[it.value] }
|
||||||
override val primitiveArrayForType = primitiveArrayElementTypes.asSequence().associate { it.value to it.key }
|
override val primitiveArrayForType = primitiveArrayElementTypes.asSequence().associate { it.value to it.key }
|
||||||
@@ -353,16 +372,24 @@ class IrBuiltInsOverDescriptors(
|
|||||||
}.toMap()
|
}.toMap()
|
||||||
|
|
||||||
override val lessFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.LESS)
|
override val lessFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.LESS)
|
||||||
override val lessOrEqualFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.LESS_OR_EQUAL)
|
override val lessOrEqualFunByOperandType =
|
||||||
override val greaterOrEqualFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.GREATER_OR_EQUAL)
|
primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.LESS_OR_EQUAL)
|
||||||
override val greaterFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.GREATER)
|
override val greaterOrEqualFunByOperandType =
|
||||||
|
primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.GREATER_OR_EQUAL)
|
||||||
|
override val greaterFunByOperandType =
|
||||||
|
primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.GREATER)
|
||||||
|
|
||||||
override val ieee754equalsFunByOperandType =
|
override val ieee754equalsFunByOperandType =
|
||||||
primitiveFloatingPointIrTypes.map {
|
primitiveFloatingPointIrTypes.map {
|
||||||
it.classifierOrFail to defineOperator(BuiltInOperatorNames.IEEE754_EQUALS, booleanType, listOf(it.makeNullable(), it.makeNullable()))
|
it.classifierOrFail to defineOperator(
|
||||||
|
BuiltInOperatorNames.IEEE754_EQUALS,
|
||||||
|
booleanType,
|
||||||
|
listOf(it.makeNullable(), it.makeNullable())
|
||||||
|
)
|
||||||
}.toMap()
|
}.toMap()
|
||||||
|
|
||||||
val booleanNot = builtIns.boolean.unsubstitutedMemberScope.getContributedFunctions(Name.identifier("not"), NoLookupLocation.FROM_BACKEND).single()
|
val booleanNot =
|
||||||
|
builtIns.boolean.unsubstitutedMemberScope.getContributedFunctions(Name.identifier("not"), NoLookupLocation.FROM_BACKEND).single()
|
||||||
override val booleanNotSymbol = symbolTable.referenceSimpleFunction(booleanNot)
|
override val booleanNotSymbol = symbolTable.referenceSimpleFunction(booleanNot)
|
||||||
|
|
||||||
override val eqeqeqSymbol = defineOperator(BuiltInOperatorNames.EQEQEQ, booleanType, listOf(anyNType, anyNType))
|
override val eqeqeqSymbol = defineOperator(BuiltInOperatorNames.EQEQEQ, booleanType, listOf(anyNType, anyNType))
|
||||||
@@ -371,8 +398,10 @@ class IrBuiltInsOverDescriptors(
|
|||||||
override val throwIseSymbol = defineOperator(BuiltInOperatorNames.THROW_ISE, nothingType, listOf())
|
override val throwIseSymbol = defineOperator(BuiltInOperatorNames.THROW_ISE, nothingType, listOf())
|
||||||
override val andandSymbol = defineOperator(BuiltInOperatorNames.ANDAND, booleanType, listOf(booleanType, booleanType))
|
override val andandSymbol = defineOperator(BuiltInOperatorNames.ANDAND, booleanType, listOf(booleanType, booleanType))
|
||||||
override val ororSymbol = defineOperator(BuiltInOperatorNames.OROR, booleanType, listOf(booleanType, booleanType))
|
override val ororSymbol = defineOperator(BuiltInOperatorNames.OROR, booleanType, listOf(booleanType, booleanType))
|
||||||
override val noWhenBranchMatchedExceptionSymbol = defineOperator(BuiltInOperatorNames.NO_WHEN_BRANCH_MATCHED_EXCEPTION, nothingType, listOf())
|
override val noWhenBranchMatchedExceptionSymbol =
|
||||||
override val illegalArgumentExceptionSymbol = defineOperator(BuiltInOperatorNames.ILLEGAL_ARGUMENT_EXCEPTION, nothingType, listOf(stringType))
|
defineOperator(BuiltInOperatorNames.NO_WHEN_BRANCH_MATCHED_EXCEPTION, nothingType, listOf())
|
||||||
|
override val illegalArgumentExceptionSymbol =
|
||||||
|
defineOperator(BuiltInOperatorNames.ILLEGAL_ARGUMENT_EXCEPTION, nothingType, listOf(stringType))
|
||||||
|
|
||||||
override val checkNotNullSymbol = defineCheckNotNullOperator()
|
override val checkNotNullSymbol = defineCheckNotNullOperator()
|
||||||
|
|
||||||
@@ -476,7 +505,7 @@ class IrBuiltInsOverDescriptors(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun <T: Any> getFunctionsByKey(
|
private fun <T : Any> getFunctionsByKey(
|
||||||
name: Name,
|
name: Name,
|
||||||
vararg packageNameSegments: String,
|
vararg packageNameSegments: String,
|
||||||
makeKey: (SimpleFunctionDescriptor) -> T?
|
makeKey: (SimpleFunctionDescriptor) -> T?
|
||||||
|
|||||||
@@ -1129,7 +1129,7 @@ fun SymbolTable.noUnboundLeft(message: String) {
|
|||||||
assert(unbound.isEmpty()) {
|
assert(unbound.isEmpty()) {
|
||||||
"$message\n" +
|
"$message\n" +
|
||||||
unbound.joinToString("\n") {
|
unbound.joinToString("\n") {
|
||||||
"$it ${it.signature?.toString() ?: "(NON-PUBLIC API)"}: ${it.descriptor}"
|
"${it::class.simpleName} $it ${it.signature?.toString() ?: "(NON-PUBLIC API)"}: ${it.descriptor}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
// !LANGUAGE: +KotlinFunInterfaceConstructorReference
|
||||||
|
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
|
// DONT_TARGET_EXACT_BACKEND: JVM
|
||||||
|
// ^ old JVM BE generates bogus code
|
||||||
|
|
||||||
|
// FILE: funInterfaceConstructorThrowsNpe.kt
|
||||||
|
|
||||||
|
fun interface KSupplier<T> {
|
||||||
|
fun get(): T
|
||||||
|
}
|
||||||
|
|
||||||
|
val ks: (() -> String) -> KSupplier<String> =
|
||||||
|
::KSupplier
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
try {
|
||||||
|
ks(J.fn)
|
||||||
|
return "ks(null) should throw NPE"
|
||||||
|
} catch (e: NullPointerException) {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: J.java
|
||||||
|
import kotlin.jvm.functions.Function0;
|
||||||
|
|
||||||
|
public class J {
|
||||||
|
public static Function0<String> fn = null;
|
||||||
|
}
|
||||||
+24
-8
@@ -65,7 +65,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -76,7 +78,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1a.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1a.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KRunnable>
|
FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KRunnable>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -87,7 +91,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1b.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1b.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -98,7 +104,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2'
|
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2'
|
||||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.String> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function0<kotlin.String>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -109,7 +117,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a'
|
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a'
|
||||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2a.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.String> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function0<kotlin.String>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2a.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a' type=kotlin.reflect.KFunction1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -120,7 +130,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function1<kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -131,7 +143,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3a.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function1<kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3a.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KConsumer<kotlin.String>>
|
FUN name:test3b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -142,5 +156,7 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3b.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=EXCLEXCL
|
||||||
|
<T0>: kotlin.Function1<kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test3b.KConsumer' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b' type=kotlin.reflect.KFunction1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
|
|||||||
+8
-8
@@ -19,7 +19,7 @@ fun interface KConsumer<T : Any?> {
|
|||||||
fun test1(): KFunction1<Function0<Unit>, KRunnable> {
|
fun test1(): KFunction1<Function0<Unit>, KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -29,7 +29,7 @@ fun test1(): KFunction1<Function0<Unit>, KRunnable> {
|
|||||||
fun test1a(): KFunction1<Function0<Unit>, KRunnable> {
|
fun test1a(): KFunction1<Function0<Unit>, KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -39,7 +39,7 @@ fun test1a(): KFunction1<Function0<Unit>, KRunnable> {
|
|||||||
fun test1b(): KFunction<KRunnable> {
|
fun test1b(): KFunction<KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -49,7 +49,7 @@ fun test1b(): KFunction<KRunnable> {
|
|||||||
fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
||||||
return function /*-> KSupplier<String> */
|
return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KSupplier
|
::KSupplier
|
||||||
@@ -59,7 +59,7 @@ fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
|||||||
fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
||||||
return function /*-> KSupplier<String> */
|
return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KSupplier
|
::KSupplier
|
||||||
@@ -69,7 +69,7 @@ fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
|||||||
fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
@@ -79,7 +79,7 @@ fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
|||||||
fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
@@ -89,7 +89,7 @@ fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
|||||||
fun test3b(): KFunction<KConsumer<String>> {
|
fun test3b(): KFunction<KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
|
|||||||
+24
-8
@@ -65,7 +65,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -76,7 +78,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1a.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1a.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KRunnable>
|
FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KRunnable>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -87,7 +91,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b'
|
RETURN type=kotlin.Nothing from='local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b'
|
||||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1b.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function0<kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1b.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1b' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -98,7 +104,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2'
|
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2'
|
||||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
|
<T0>: kotlin.Function0<kotlin.String>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -109,7 +117,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a'
|
RETURN type=kotlin.Nothing from='local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a'
|
||||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2a.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
|
<T0>: kotlin.Function0<kotlin.String>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2a.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -120,7 +130,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -131,7 +143,9 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3a.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3a.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
FUN name:test3b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KConsumer<kotlin.String>>
|
FUN name:test3b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<<root>.KConsumer<kotlin.String>>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -142,5 +156,7 @@ FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b'
|
RETURN type=kotlin.Nothing from='local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b'
|
||||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||||
GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3b.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): T0 of kotlin.internal.ir.CHECK_NOT_NULL declared in kotlin.internal.ir' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
|
<T0>: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>
|
||||||
|
arg0: GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3b.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3b' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||||
|
|||||||
+8
-8
@@ -19,7 +19,7 @@ typealias KCS = KConsumer<String>
|
|||||||
fun test1(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
fun test1(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -29,7 +29,7 @@ fun test1(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunn
|
|||||||
fun test1a(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
fun test1a(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -39,7 +39,7 @@ fun test1a(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRun
|
|||||||
fun test1b(): KFunction<KRunnable> {
|
fun test1b(): KFunction<KRunnable> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
local fun KRunnable(function: Function0<Unit>): KRunnable {
|
||||||
return function /*-> KRunnable */
|
return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KRunnable
|
::KRunnable
|
||||||
@@ -49,7 +49,7 @@ fun test1b(): KFunction<KRunnable> {
|
|||||||
fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
||||||
return function /*-> KSupplier<String> */
|
return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KSupplier
|
::KSupplier
|
||||||
@@ -59,7 +59,7 @@ fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
|||||||
fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
local fun KSupplier(function: Function0<String>): KSupplier<String> {
|
||||||
return function /*-> KSupplier<String> */
|
return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KSupplier
|
::KSupplier
|
||||||
@@ -69,7 +69,7 @@ fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
|||||||
fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<@ParameterName(name = "x") String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
@@ -79,7 +79,7 @@ fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
|||||||
fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<@ParameterName(name = "x") String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
@@ -89,7 +89,7 @@ fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
|||||||
fun test3b(): KFunction<KConsumer<String>> {
|
fun test3b(): KFunction<KConsumer<String>> {
|
||||||
return { // BLOCK
|
return { // BLOCK
|
||||||
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
local fun KConsumer(function: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> {
|
||||||
return function /*-> KConsumer<String> */
|
return CHECK_NOT_NULL<Function1<@ParameterName(name = "x") String, Unit>>(arg0 = function) /*-> KConsumer<String> */
|
||||||
}
|
}
|
||||||
|
|
||||||
::KConsumer
|
::KConsumer
|
||||||
|
|||||||
+6
@@ -3518,6 +3518,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
public void testFunInterfaceConstructor() throws Exception {
|
public void testFunInterfaceConstructor() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt");
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("funInterfaceConstructorThrowsNpe.kt")
|
||||||
|
public void testFunInterfaceConstructorThrowsNpe() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorThrowsNpe.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+6
@@ -3602,6 +3602,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
public void testFunInterfaceConstructorEquality() throws Exception {
|
public void testFunInterfaceConstructorEquality() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorEquality.kt");
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorEquality.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("funInterfaceConstructorThrowsNpe.kt")
|
||||||
|
public void testFunInterfaceConstructorThrowsNpe() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorThrowsNpe.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+5
@@ -3078,6 +3078,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt");
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funInterfaceConstructorThrowsNpe.kt")
|
||||||
|
public void ignoreFunInterfaceConstructorThrowsNpe() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructorThrowsNpe.kt");
|
||||||
|
}
|
||||||
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2514,7 +2514,7 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest {
|
|||||||
public class FunInterfaceConstructor {
|
public class FunInterfaceConstructor {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInFunInterfaceConstructor() throws Exception {
|
public void testAllFilesPresentInFunInterfaceConstructor() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user