FIR2IR: apply SAM conversion to arguments if needed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0ce16b9d8c
commit
6034fcdc46
@@ -459,3 +459,10 @@ fun FirClass<*>.irOrigin(firProvider: FirProvider): IrDeclarationOrigin = when {
|
|||||||
origin == FirDeclarationOrigin.Java -> IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
|
origin == FirDeclarationOrigin.Java -> IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
|
||||||
else -> IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB
|
else -> IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val IrType.isSamType: Boolean
|
||||||
|
get() {
|
||||||
|
val irClass = classOrNull ?: return false
|
||||||
|
val am = irClass.functions.singleOrNull { it.owner.modality == Modality.ABSTRACT }
|
||||||
|
return am != null
|
||||||
|
}
|
||||||
|
|||||||
+29
-11
@@ -6,6 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.fir.backend.generators
|
package org.jetbrains.kotlin.fir.backend.generators
|
||||||
|
|
||||||
import org.jetbrains.kotlin.fir.backend.*
|
import org.jetbrains.kotlin.fir.backend.*
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
||||||
import org.jetbrains.kotlin.fir.expressions.*
|
import org.jetbrains.kotlin.fir.expressions.*
|
||||||
@@ -16,6 +17,7 @@ import org.jetbrains.kotlin.fir.references.FirReference
|
|||||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||||
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||||
import org.jetbrains.kotlin.fir.render
|
import org.jetbrains.kotlin.fir.render
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType
|
||||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||||
@@ -28,6 +30,7 @@ import org.jetbrains.kotlin.ir.declarations.IrProperty
|
|||||||
import org.jetbrains.kotlin.ir.expressions.IrErrorCallExpression
|
import org.jetbrains.kotlin.ir.expressions.IrErrorCallExpression
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||||
|
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||||
import org.jetbrains.kotlin.ir.symbols.*
|
import org.jetbrains.kotlin.ir.symbols.*
|
||||||
import org.jetbrains.kotlin.ir.types.*
|
import org.jetbrains.kotlin.ir.types.*
|
||||||
@@ -325,22 +328,22 @@ internal class CallAndReferenceGenerator(
|
|||||||
val argumentsCount = call.arguments.size
|
val argumentsCount = call.arguments.size
|
||||||
if (argumentsCount <= valueArgumentsCount) {
|
if (argumentsCount <= valueArgumentsCount) {
|
||||||
apply {
|
apply {
|
||||||
|
val calleeReference = when (call) {
|
||||||
|
is FirFunctionCall -> call.calleeReference
|
||||||
|
is FirDelegatedConstructorCall -> call.calleeReference
|
||||||
|
else -> null
|
||||||
|
} as? FirResolvedNamedReference
|
||||||
|
val function = (calleeReference?.resolvedSymbol as? FirFunctionSymbol<*>)?.fir
|
||||||
|
val valueParameters = function?.valueParameters
|
||||||
val argumentMapping = call.argumentMapping
|
val argumentMapping = call.argumentMapping
|
||||||
if (argumentMapping != null && argumentMapping.isNotEmpty()) {
|
if (argumentMapping != null && argumentMapping.isNotEmpty()) {
|
||||||
val calleeReference = when (call) {
|
|
||||||
is FirFunctionCall -> call.calleeReference
|
|
||||||
is FirDelegatedConstructorCall -> call.calleeReference
|
|
||||||
else -> throw IllegalArgumentException("Unsupported call: ${call.render()}")
|
|
||||||
} as? FirResolvedNamedReference
|
|
||||||
val function = (calleeReference?.resolvedSymbol as? FirFunctionSymbol<*>)?.fir
|
|
||||||
val valueParameters = function?.valueParameters
|
|
||||||
|
|
||||||
if (valueParameters != null) {
|
if (valueParameters != null) {
|
||||||
return applyArgumentsWithReorderingIfNeeded(argumentMapping, valueParameters)
|
return applyArgumentsWithReorderingIfNeeded(argumentMapping, valueParameters)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ((index, argument) in call.arguments.withIndex()) {
|
for ((index, argument) in call.arguments.withIndex()) {
|
||||||
val argumentExpression = visitor.convertToIrExpression(argument)
|
val argumentExpression =
|
||||||
|
visitor.convertToIrExpression(argument).applySamConversionIfNeeded(argument, valueParameters?.get(index))
|
||||||
putValueArgument(index, argumentExpression)
|
putValueArgument(index, argumentExpression)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,7 +376,7 @@ internal class CallAndReferenceGenerator(
|
|||||||
return IrBlockImpl(startOffset, endOffset, type, IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL).apply {
|
return IrBlockImpl(startOffset, endOffset, type, IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL).apply {
|
||||||
for ((argument, parameter) in argumentMapping) {
|
for ((argument, parameter) in argumentMapping) {
|
||||||
val parameterIndex = valueParameters.indexOf(parameter)
|
val parameterIndex = valueParameters.indexOf(parameter)
|
||||||
val irArgument = visitor.convertToIrExpression(argument)
|
val irArgument = visitor.convertToIrExpression(argument).applySamConversionIfNeeded(argument, parameter)
|
||||||
if (irArgument.hasNoSideEffects()) {
|
if (irArgument.hasNoSideEffects()) {
|
||||||
putValueArgument(parameterIndex, irArgument)
|
putValueArgument(parameterIndex, irArgument)
|
||||||
} else {
|
} else {
|
||||||
@@ -388,7 +391,7 @@ internal class CallAndReferenceGenerator(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for ((argument, parameter) in argumentMapping) {
|
for ((argument, parameter) in argumentMapping) {
|
||||||
val argumentExpression = visitor.convertToIrExpression(argument)
|
val argumentExpression = visitor.convertToIrExpression(argument).applySamConversionIfNeeded(argument, parameter)
|
||||||
putValueArgument(valueParameters.indexOf(parameter), argumentExpression)
|
putValueArgument(valueParameters.indexOf(parameter), argumentExpression)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
@@ -410,6 +413,21 @@ internal class CallAndReferenceGenerator(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun IrExpression.applySamConversionIfNeeded(
|
||||||
|
argument: FirExpression,
|
||||||
|
parameter: FirValueParameter?
|
||||||
|
): IrExpression {
|
||||||
|
if (parameter == null ||
|
||||||
|
parameter.returnTypeRef.coneTypeSafe<ConeKotlinType>()?.isBuiltinFunctionalType(session) == true
|
||||||
|
) return this
|
||||||
|
if (argument !is FirLambdaArgumentExpression) return this
|
||||||
|
if (argument.expression !is FirAnonymousFunction) return this
|
||||||
|
if (argument.expression.typeRef == parameter.returnTypeRef) return this
|
||||||
|
val samType = parameter.returnTypeRef.toIrType()
|
||||||
|
if (!samType.isSamType) return this
|
||||||
|
return IrTypeOperatorCallImpl(this.startOffset, this.endOffset, samType, IrTypeOperator.SAM_CONVERSION, samType, this)
|
||||||
|
}
|
||||||
|
|
||||||
private fun IrExpression.applyTypeArguments(access: FirQualifiedAccess): IrExpression {
|
private fun IrExpression.applyTypeArguments(access: FirQualifiedAccess): IrExpression {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
is IrMemberAccessExpressionBase -> {
|
is IrMemberAccessExpressionBase -> {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// SKIP_DCE_DRIVEN
|
// SKIP_DCE_DRIVEN
|
||||||
|
|
||||||
fun interface Foo {
|
fun interface Foo {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// IGNORE_BACKEND: JS_IR
|
// IGNORE_BACKEND: JS_IR
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
|
|
||||||
fun interface FunInterface {
|
fun interface FunInterface {
|
||||||
fun invoke()
|
fun invoke()
|
||||||
|
|||||||
+6
-5
@@ -26,8 +26,9 @@ FILE fqName:<root> fileName:/basicFunInterfaceConversion.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun test (): kotlin.String declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun test (): kotlin.String declared in <root>'
|
||||||
CALL 'public final fun foo (f: <root>.Foo): kotlin.String declared in <root>' type=kotlin.String origin=null
|
CALL 'public final fun foo (f: <root>.Foo): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||||
f: FUN_EXPR type=kotlin.Function0<kotlin.String> origin=LAMBDA
|
f: TYPE_OP type=<root>.Foo origin=SAM_CONVERSION typeOperand=<root>.Foo
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.String
|
FUN_EXPR type=kotlin.Function0<kotlin.String> origin=LAMBDA
|
||||||
BLOCK_BODY
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.String
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.test'
|
BLOCK_BODY
|
||||||
CONST String type=kotlin.String value="OK"
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.test'
|
||||||
|
CONST String type=kotlin.String value="OK"
|
||||||
|
|||||||
@@ -139,14 +139,15 @@ FILE fqName:<root> fileName:/partialSam.kt
|
|||||||
CALL 'public final fun runConversion (f1: <root>.Fn<kotlin.String, kotlin.Int>, f2: <root>.Fn<kotlin.Int, kotlin.String>): kotlin.Int declared in <root>.J' type=kotlin.Int origin=null
|
CALL 'public final fun runConversion (f1: <root>.Fn<kotlin.String, kotlin.Int>, f2: <root>.Fn<kotlin.Int, kotlin.String>): kotlin.Int declared in <root>.J' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||||
f1: CALL 'public final fun <get-fsi> (): <root>.fsi.<no name provided> declared in <root>' type=<root>.fsi.<no name provided> origin=GET_PROPERTY
|
f1: CALL 'public final fun <get-fsi> (): <root>.fsi.<no name provided> declared in <root>' type=<root>.fsi.<no name provided> origin=GET_PROPERTY
|
||||||
f2: FUN_EXPR type=kotlin.Function3<kotlin.String, kotlin.Int, kotlin.Int, kotlin.String> origin=LAMBDA
|
f2: TYPE_OP type=<root>.Fn<kotlin.Int, kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.Fn<kotlin.Int, kotlin.String>
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ti:kotlin.Int) returnType:kotlin.String
|
FUN_EXPR type=kotlin.Function3<kotlin.String, kotlin.Int, kotlin.Int, kotlin.String> origin=LAMBDA
|
||||||
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (s:kotlin.String, i:kotlin.Int, ti:kotlin.Int) returnType:kotlin.String
|
||||||
VALUE_PARAMETER name:i index:1 type:kotlin.Int
|
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||||
VALUE_PARAMETER name:ti index:2 type:kotlin.Int
|
VALUE_PARAMETER name:i index:1 type:kotlin.Int
|
||||||
BLOCK_BODY
|
VALUE_PARAMETER name:ti index:2 type:kotlin.Int
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (s: kotlin.String, i: kotlin.Int, ti: kotlin.Int): kotlin.String declared in <root>.test'
|
BLOCK_BODY
|
||||||
CONST String type=kotlin.String value=""
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (s: kotlin.String, i: kotlin.Int, ti: kotlin.Int): kotlin.String declared in <root>.test'
|
||||||
|
CONST String type=kotlin.String value=""
|
||||||
CALL 'public final fun runConversion (f1: <root>.Fn<kotlin.String, kotlin.Int>, f2: <root>.Fn<kotlin.Int, kotlin.String>): kotlin.Int declared in <root>.J' type=kotlin.Int origin=null
|
CALL 'public final fun runConversion (f1: <root>.Fn<kotlin.String, kotlin.Int>, f2: <root>.Fn<kotlin.Int, kotlin.String>): kotlin.Int declared in <root>.J' type=kotlin.Int origin=null
|
||||||
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||||
f1: FUN_EXPR type=kotlin.Function3<kotlin.String, kotlin.Int, kotlin.String, kotlin.Int> origin=LAMBDA
|
f1: FUN_EXPR type=kotlin.Function3<kotlin.String, kotlin.Int, kotlin.String, kotlin.Int> origin=LAMBDA
|
||||||
|
|||||||
@@ -94,26 +94,27 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
$this: GET_VAR '<this>: <root>.ProducerScope<kotlin.Any> declared in <root>.asFairChannel.<anonymous>' type=<root>.ProducerScope<kotlin.Any> origin=null
|
$this: GET_VAR '<this>: <root>.ProducerScope<kotlin.Any> declared in <root>.asFairChannel.<anonymous>' type=<root>.ProducerScope<kotlin.Any> origin=null
|
||||||
CALL 'public abstract fun collect (collector: <root>.FlowCollector<T of <root>.Flow>): kotlin.Unit [suspend] declared in <root>.Flow' type=kotlin.Unit origin=null
|
CALL 'public abstract fun collect (collector: <root>.FlowCollector<T of <root>.Flow>): kotlin.Unit [suspend] declared in <root>.Flow' type=kotlin.Unit origin=null
|
||||||
$this: GET_VAR 'flow: <root>.Flow<*> declared in <root>.asFairChannel' type=<root>.Flow<*> origin=null
|
$this: GET_VAR 'flow: <root>.Flow<*> declared in <root>.asFairChannel' type=<root>.Flow<*> origin=null
|
||||||
collector: FUN_EXPR type=kotlin.Function1<kotlin.Any?, kotlin.Unit> origin=LAMBDA
|
collector: TYPE_OP type=<root>.FlowCollector<kotlin.Any?> origin=SAM_CONVERSION typeOperand=<root>.FlowCollector<kotlin.Any?>
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit
|
FUN_EXPR type=kotlin.Function1<kotlin.Any?, kotlin.Unit> origin=LAMBDA
|
||||||
VALUE_PARAMETER name:value index:0 type:kotlin.Any?
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit
|
||||||
BLOCK_BODY
|
VALUE_PARAMETER name:value index:0 type:kotlin.Any?
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (value: kotlin.Any?): kotlin.Unit declared in <root>.asFairChannel.<anonymous>'
|
BLOCK_BODY
|
||||||
CALL 'public final fun sendFair (element: E of <root>.ChannelCoroutine): kotlin.Unit [suspend] declared in <root>.ChannelCoroutine' type=kotlin.Unit origin=null
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (value: kotlin.Any?): kotlin.Unit declared in <root>.asFairChannel.<anonymous>'
|
||||||
$this: GET_VAR 'val channel: <root>.ChannelCoroutine<kotlin.Any> [val] declared in <root>.asFairChannel.<anonymous>' type=<root>.ChannelCoroutine<kotlin.Any> origin=null
|
CALL 'public final fun sendFair (element: E of <root>.ChannelCoroutine): kotlin.Unit [suspend] declared in <root>.ChannelCoroutine' type=kotlin.Unit origin=null
|
||||||
element: BLOCK type=kotlin.Any origin=ELVIS
|
$this: GET_VAR 'val channel: <root>.ChannelCoroutine<kotlin.Any> [val] declared in <root>.asFairChannel.<anonymous>' type=<root>.ChannelCoroutine<kotlin.Any> origin=null
|
||||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val]
|
element: BLOCK type=kotlin.Any origin=ELVIS
|
||||||
GET_VAR 'value: kotlin.Any? declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val]
|
||||||
WHEN type=kotlin.Any origin=ELVIS
|
GET_VAR 'value: kotlin.Any? declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
BRANCH
|
WHEN type=kotlin.Any origin=ELVIS
|
||||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
BRANCH
|
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
|
||||||
if: CONST Boolean type=kotlin.Boolean value=true
|
BRANCH
|
||||||
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
|
||||||
|
GET_VAR 'val tmp_0: kotlin.Any? [val] declared in <root>.asFairChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
FUN name:asChannel visibility:private modality:FINAL <> ($receiver:<root>.CoroutineScope, flow:<root>.Flow<*>) returnType:<root>.ReceiveChannel<kotlin.Any>
|
FUN name:asChannel visibility:private modality:FINAL <> ($receiver:<root>.CoroutineScope, flow:<root>.Flow<*>) returnType:<root>.ReceiveChannel<kotlin.Any>
|
||||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.CoroutineScope
|
$receiver: VALUE_PARAMETER name:<this> type:<root>.CoroutineScope
|
||||||
VALUE_PARAMETER name:flow index:0 type:<root>.Flow<*>
|
VALUE_PARAMETER name:flow index:0 type:<root>.Flow<*>
|
||||||
@@ -128,27 +129,28 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun collect (collector: <root>.FlowCollector<T of <root>.Flow>): kotlin.Unit [suspend] declared in <root>.Flow' type=kotlin.Unit origin=null
|
CALL 'public abstract fun collect (collector: <root>.FlowCollector<T of <root>.Flow>): kotlin.Unit [suspend] declared in <root>.Flow' type=kotlin.Unit origin=null
|
||||||
$this: GET_VAR 'flow: <root>.Flow<*> declared in <root>.asChannel' type=<root>.Flow<*> origin=null
|
$this: GET_VAR 'flow: <root>.Flow<*> declared in <root>.asChannel' type=<root>.Flow<*> origin=null
|
||||||
collector: FUN_EXPR type=kotlin.Function1<kotlin.Any?, kotlin.Unit> origin=LAMBDA
|
collector: TYPE_OP type=<root>.FlowCollector<kotlin.Any?> origin=SAM_CONVERSION typeOperand=<root>.FlowCollector<kotlin.Any?>
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit
|
FUN_EXPR type=kotlin.Function1<kotlin.Any?, kotlin.Unit> origin=LAMBDA
|
||||||
VALUE_PARAMETER name:value index:0 type:kotlin.Any?
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (value:kotlin.Any?) returnType:kotlin.Unit
|
||||||
BLOCK_BODY
|
VALUE_PARAMETER name:value index:0 type:kotlin.Any?
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (value: kotlin.Any?): kotlin.Unit declared in <root>.asChannel.<anonymous>'
|
BLOCK_BODY
|
||||||
CALL 'public abstract fun send (e: E of <root>.SendChannel): kotlin.Unit [suspend] declared in <root>.SendChannel' type=kotlin.Unit origin=null
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (value: kotlin.Any?): kotlin.Unit declared in <root>.asChannel.<anonymous>'
|
||||||
$this: CALL 'public abstract fun <get-channel> (): <root>.SendChannel<E of <root>.ProducerScope> declared in <root>.ProducerScope' type=<root>.SendChannel<kotlin.Any> origin=GET_PROPERTY
|
CALL 'public abstract fun send (e: E of <root>.SendChannel): kotlin.Unit [suspend] declared in <root>.SendChannel' type=kotlin.Unit origin=null
|
||||||
$this: GET_VAR '<this>: <root>.ProducerScope<kotlin.Any> declared in <root>.asChannel.<anonymous>' type=<root>.ProducerScope<kotlin.Any> origin=null
|
$this: CALL 'public abstract fun <get-channel> (): <root>.SendChannel<E of <root>.ProducerScope> declared in <root>.ProducerScope' type=<root>.SendChannel<kotlin.Any> origin=GET_PROPERTY
|
||||||
e: BLOCK type=kotlin.Any origin=ELVIS
|
$this: GET_VAR '<this>: <root>.ProducerScope<kotlin.Any> declared in <root>.asChannel.<anonymous>' type=<root>.ProducerScope<kotlin.Any> origin=null
|
||||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val]
|
e: BLOCK type=kotlin.Any origin=ELVIS
|
||||||
GET_VAR 'value: kotlin.Any? declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val]
|
||||||
WHEN type=kotlin.Any origin=ELVIS
|
GET_VAR 'value: kotlin.Any? declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
BRANCH
|
WHEN type=kotlin.Any origin=ELVIS
|
||||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
BRANCH
|
||||||
arg0: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
arg0: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
|
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||||
BRANCH
|
then: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' type=kotlin.Any origin=null
|
||||||
if: CONST Boolean type=kotlin.Boolean value=true
|
BRANCH
|
||||||
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
|
if: CONST Boolean type=kotlin.Boolean value=true
|
||||||
GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any
|
||||||
|
GET_VAR 'val tmp_1: kotlin.Any? [val] declared in <root>.asChannel.<anonymous>.<anonymous>' type=kotlin.Any? origin=null
|
||||||
CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[<root>.FlowCollector<T of <root>.SafeCollector>]
|
CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[<root>.FlowCollector<T of <root>.SafeCollector>]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SafeCollector<T of <root>.SafeCollector>
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SafeCollector<T of <root>.SafeCollector>
|
||||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
||||||
|
|||||||
Reference in New Issue
Block a user