Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#107 fix crash on iOS with fun interface #118

Merged
merged 3 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mvvm-livedata/api/mvvm-livedata.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ public final class dev/icerock/moko/mvvm/livedata/CheckBoxBindingsKt {
}

public abstract interface class dev/icerock/moko/mvvm/livedata/Closeable {
public static final field Companion Ldev/icerock/moko/mvvm/livedata/Closeable$Companion;
public abstract fun close ()V
public abstract fun plus (Ldev/icerock/moko/mvvm/livedata/Closeable;)Ldev/icerock/moko/mvvm/livedata/Closeable;
}

public final class dev/icerock/moko/mvvm/livedata/Closeable$Companion {
public final fun invoke (Lkotlin/jvm/functions/Function0;)Ldev/icerock/moko/mvvm/livedata/Closeable;
}

public final class dev/icerock/moko/mvvm/livedata/Closeable$DefaultImpls {
public static fun plus (Ldev/icerock/moko/mvvm/livedata/Closeable;Ldev/icerock/moko/mvvm/livedata/Closeable;)Ldev/icerock/moko/mvvm/livedata/Closeable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package dev.icerock.moko.mvvm.livedata

fun interface Closeable {
interface Closeable {
fun close()

operator fun plus(other: Closeable): Closeable {
Expand All @@ -13,4 +13,14 @@ fun interface Closeable {
other.close()
}
}

companion object {
operator fun invoke(block: () -> Unit): Closeable {
return object : Closeable {
override fun close() {
block()
}
}
}
}
}