diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-25 15:24:24 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-25 15:24:24 +0000 |
commit | 166afcab412d1fdbcef19de3421effc4e886f417 (patch) | |
tree | 56172afea542cda6309eaf75f2736703885f071a /src/library | |
parent | 020add45b8a91e77e3f32fdb4a321fdb925484c5 (diff) | |
download | scala-166afcab412d1fdbcef19de3421effc4e886f417.tar.gz scala-166afcab412d1fdbcef19de3421effc4e886f417.tar.bz2 scala-166afcab412d1fdbcef19de3421effc4e886f417.zip |
Altered 2-argument versions of Predef's assert,...
Altered 2-argument versions of Predef's assert, assume, and require to
be call-by-name.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Predef.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 02b0bfef6b..6662c5cf36 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -87,7 +87,7 @@ object Predef { throw new java.lang.AssertionError("assertion failed") } - def assert(assertion: Boolean, message: Any) { + def assert(assertion: Boolean, message: => Any) { if (!assertion) throw new java.lang.AssertionError("assertion failed: "+ message) } @@ -97,7 +97,7 @@ object Predef { throw new java.lang.AssertionError("assumption failed") } - def assume(assumption: Boolean, message: Any) { + def assume(assumption: Boolean, message: => Any) { if (!assumption) throw new java.lang.AssertionError("assumption failed: "+ message) } @@ -107,7 +107,7 @@ object Predef { throw new IllegalArgumentException("requirement failed") } - def require(requirement: Boolean, message: Any) { + def require(requirement: Boolean, message: => Any) { if (!requirement) throw new IllegalArgumentException("requirement failed: "+ message) } |