Skip to content
Snippets Groups Projects
Commit 8120a2a3 authored by Sandro Stucki's avatar Sandro Stucki Committed by Manos Koukoutos
Browse files

Changes argument of '==>' to be by-name.

parent a6724892
Branches
Tags
No related merge requests found
...@@ -16,8 +16,8 @@ package object lang { ...@@ -16,8 +16,8 @@ package object lang {
} }
@inline @inline
def ==> (that: Boolean): Boolean = { def ==>(that: => Boolean): Boolean = {
!underlying || that if (underlying) that else true
} }
} }
...@@ -40,11 +40,11 @@ package object lang { ...@@ -40,11 +40,11 @@ package object lang {
@ignore @ignore
def error[T](reason: java.lang.String): T = sys.error(reason) def error[T](reason: java.lang.String): T = sys.error(reason)
@ignore @ignore
implicit class Passes[A,B](io : (A,B)) { implicit class Passes[A,B](io : (A,B)) {
val (in, out) = io val (in, out) = io
def passes(tests : A => B ) : Boolean = def passes(tests : A => B ) : Boolean =
try { tests(in) == out } catch { case _ : MatchError => true } try { tests(in) == out } catch { case _ : MatchError => true }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment