Skip to content
Snippets Groups Projects
Commit 051688f8 authored by Emmanouil (Manos) Koukoutos's avatar Emmanouil (Manos) Koukoutos
Browse files

Option.get in Leon library

parent 8b5a1abd
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,14 @@ import leon.annotation._ ...@@ -6,6 +6,14 @@ import leon.annotation._
@library @library
sealed abstract class Option[T] { sealed abstract class Option[T] {
def get : T = {
require(this.isDefined)
this match {
case Some(x) => x
}
}
def getOrElse(default: T) = this match { def getOrElse(default: T) = this match {
case Some(v) => v case Some(v) => v
case None() => default case None() => default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment