diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-01-07 17:24:21 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-01-07 17:24:21 +0000 |
commit | 6f3aa39042f58ed869fa785dea593e9e07c6229a (patch) | |
tree | 17973f4c1297ed95ffe37f3f3b0e12a95b0ed68c /src/library | |
parent | 4c879e308827260f5d0aa037819a88a565db4cb4 (diff) | |
download | scala-6f3aa39042f58ed869fa785dea593e9e07c6229a.tar.gz scala-6f3aa39042f58ed869fa785dea593e9e07c6229a.tar.bz2 scala-6f3aa39042f58ed869fa785dea593e9e07c6229a.zip |
Added final modifiers to several classes used b...
Added final modifiers to several classes used by Predef implicits.
Review by community.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Predef.scala | 4 | ||||
-rw-r--r-- | src/library/scala/collection/immutable/StringOps.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 1b9f4b75ba..5684c91aaa 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -117,7 +117,7 @@ object Predef extends LowPriorityImplicits { throw new IllegalArgumentException("requirement failed: "+ message) } - class Ensuring[A](x: A) { + final class Ensuring[A](val x: A) { def ensuring(cond: Boolean): A = { assert(cond); x } def ensuring(cond: Boolean, msg: Any): A = { assert(cond, msg); x } def ensuring(cond: A => Boolean): A = { assert(cond(x)); x } @@ -139,7 +139,7 @@ object Predef extends LowPriorityImplicits { def unapply[A, B, C](x: Tuple3[A, B, C]): Option[Tuple3[A, B, C]] = Some(x) } - class ArrowAssoc[A](x: A) { + final class ArrowAssoc[A](val x: A) { @inline def -> [B](y: B): Tuple2[A, B] = Tuple2(x, y) def →[B](y: B): Tuple2[A, B] = ->(y) } diff --git a/src/library/scala/collection/immutable/StringOps.scala b/src/library/scala/collection/immutable/StringOps.scala index 9138c2bbac..db6479742b 100644 --- a/src/library/scala/collection/immutable/StringOps.scala +++ b/src/library/scala/collection/immutable/StringOps.scala @@ -17,7 +17,7 @@ import mutable.StringBuilder /** * @since 2.8 */ -class StringOps(override val repr: String) extends StringLike[String] { +final class StringOps(override val repr: String) extends StringLike[String] { override protected[this] def thisCollection: WrappedString = new WrappedString(repr) override protected[this] def toCollection(repr: String): WrappedString = new WrappedString(repr) |