-
-
Save octylFractal/34ae00f1436d5391c7d427b74ab1850f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Metadata(mv = { 1, 1, 16 }, bv = { 1, 0, 3 }, k = 2, d1 = { "\u0000\u001c\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\u001a5\u0010\u0000\u001a\u00020\u00012\"\u0010\u0002\u001a\u001e\b\u0001\u0012\u0004\u0012\u00020\u0004\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0003H\u0086@\u00f8\u0001\u0000¢\u0006\u0002\u0010\u0007\u001a5\u0010\b\u001a\u00020\u00012\"\u0010\u0002\u001a\u001e\b\u0001\u0012\u0004\u0012\u00020\u0004\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00010\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0003H\u0086@\u00f8\u0001\u0000¢\u0006\u0002\u0010\u0007\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\t" }, d2 = { "withRet", "", "emit", "Lkotlin/Function2;", "", "Lkotlin/coroutines/Continuation;", "", "(Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "withoutRet", "kotlin-playground-gradle" }) | |
public final class TCECheckKt | |
{ | |
@Nullable | |
public static final Object withRet(@NotNull final Function2<? super String, ? super Continuation<? super Unit>, ?> emit, @NotNull final Continuation<? super Unit> $completion) { | |
final Flow $this$collect$iv = /*EL:5*/FlowKt.flowOf((Object)"irrelevant"); | |
final int $i$f$collect = /*EL:6*/0; | |
final Object collect = /*EL:18*/$this$collect$iv.collect((FlowCollector)new TCECheckKt$withRet$$inlined$collect$1((Function2)emit), (Continuation)$completion); | |
if (collect == IntrinsicsKt.getCOROUTINE_SUSPENDED()) { | |
return collect; | |
} | |
/*SL:20*/return Unit.INSTANCE; | |
} | |
@Nullable | |
public static final Object withoutRet(@NotNull final Function2<? super String, ? super Continuation<? super Unit>, ?> emit, @NotNull final Continuation<? super Unit> $completion) { | |
final Flow $this$collect$iv = /*EL:12*/FlowKt.flowOf((Object)"irrelevant"); | |
final int $i$f$collect = /*EL:13*/0; | |
final Object collect = /*EL:21*/$this$collect$iv.collect((FlowCollector)new TCECheckKt$withoutRet$$inlined$collect$1((Function2)emit), (Continuation)$completion); | |
if (collect == IntrinsicsKt.getCOROUTINE_SUSPENDED()) { | |
return collect; | |
} | |
/*SL:23*/return Unit.INSTANCE; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.flow.collect | |
import kotlinx.coroutines.flow.flowOf | |
suspend fun withRet(emit: suspend (String) -> Unit) { | |
return flowOf("irrelevant") | |
.collect { | |
return@collect emit(it) | |
} | |
} | |
suspend fun withoutRet(emit: suspend (String) -> Unit) { | |
return flowOf("irrelevant") | |
.collect { | |
emit(it) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment