Skip to content

Commit

Permalink
Update Variant.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Sep 23, 2024
1 parent e3a75b2 commit db94a36
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sealed class Variant3<out A, out B, out C> {
@DoNotStrip
data class Third<C>(val value: C) : Variant3<Nothing, Nothing, C>()

@DoNotStrip
inline fun <reified T> getAs(): T? = when (this) {
is First -> value as? T
is Second -> value as? T
Expand Down

0 comments on commit db94a36

Please sign in to comment.