net.scalax.simple.adt.IsFinishAndNothing.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-adt_sjs1_2.12 Show documentation
Show all versions of simple-adt_sjs1_2.12 Show documentation
Simple, and scalable. Use it to subvert the author's imagination.
The newest version!
package net.scalax.simple.adt
import scala.annotation.meta.param
final class IsFinishAndNothing(@(transient @param) obj: Any) {
def default[T](t: => T): T = t
def isEnded: IsFinishAndNothing = this
def matchErrorAndThrowException: Nothing = throw new MatchError(obj)
}
object IsFinishAndNothing {
def value(obj: Any): IsFinishAndNothing = new IsFinishAndNothing(obj)
}