Permalink
Browse files

SI-7247, deprecated NotNull.

Removed NotNull from tests and the parentage of AnyVal.

Removed the tests which were actually testing anything to
do with NotNull; massaged the others to forget NotNull and/or
not to name local things NotNull.
  • Loading branch information...
1 parent a4c3388 commit 3fe7b8c0a8c86b38d010f37887092ce665f08df2 @paulp paulp committed Mar 13, 2013
@@ -52,6 +52,6 @@ package scala
* as well as in [[http://docs.scala-lang.org/sips/pending/value-classes.html SIP-15: Value Classes]],
* the Scala Improvement Proposal.
*/
-abstract class AnyVal extends Any with NotNull {
+abstract class AnyVal extends Any {
def getClass(): Class[_ <: AnyVal] = null
}
@@ -12,4 +12,6 @@ package scala
* A marker trait for things that are not allowed to be null
* @since 2.5
*/
+
+@deprecated("This trait will be removed", "2.11.0")
trait NotNull extends Any {}
@@ -490,7 +490,7 @@ trait TypeComparers {
/** Third try, on the right:
* - decompose refined types.
- * - handle typerefs, existentials, and notnull types.
+ * - handle typerefs and existentials.
* - handle left+right method types, polytypes, typebounds
*/
def thirdTry = tp2 match {
@@ -534,7 +534,7 @@ trait TypeComparers {
}
/** Fourth try, on the left:
- * - handle typerefs, refined types, notnull and singleton types.
+ * - handle typerefs, refined types, and singleton types.
*/
def fourthTry = tp1 match {
case tr1 @ TypeRef(pre1, sym1, _) =>
@@ -2,13 +2,13 @@ class Top[A] {
type AType = A
}
-trait Node extends NotNull { outer =>
+trait Node { outer =>
type T <: Node
def prepend = new Node { type T = outer.type }
}
class Main[NextType <: Node](value: Node { type T = NextType })
extends Top[Node { type T = NextType }] {
-
+
new Main[AType]( (value: AType).prepend )
}
@@ -1,4 +1,4 @@
t3977.scala:12: error: could not find implicit value for parameter w: False#If[E]
- new NotNull
+ new NoNull
^
one error found
@@ -7,7 +7,7 @@ trait False extends Bool {
}
class Field[E, N <: Bool](implicit val w: N#If[E]) {
- type NotNull = Field[E, False]
+ type NoNull = Field[E, False]
- new NotNull
-}
+ new NoNull
+}
@@ -1,5 +0,0 @@
-object A {
- val a: NotNull = ""
- val b: NotNull = 41
-}
-
@@ -1,11 +0,0 @@
-trait X extends NotNull {
- def foo = 1
-}
-
-trait Y extends Object with NotNull {
- def bar = 1
-}
-
-class Z extends NotNull
-
-class W extends Object with NotNull
@@ -1,4 +1,4 @@
-Found NotNull
+Found NoNull
Found lower
Found 2
A single ident is always a pattern
@@ -1,14 +1,14 @@
sealed trait ColumnOption
-case object NotNull extends ColumnOption
+case object NoNull extends ColumnOption
case object PrimaryKey extends ColumnOption
case object lower extends ColumnOption
object Test {
def main(args: Array[String]) {
- val l = List(PrimaryKey, NotNull, lower)
+ val l = List(PrimaryKey, NoNull, lower)
// withFilter must be generated in these
- for (option @ NotNull <- l) println("Found " + option)
+ for (option @ NoNull <- l) println("Found " + option)
for (option @ `lower` <- l) println("Found " + option)
for ((`lower`, i) <- l.zipWithIndex) println("Found " + i)

0 comments on commit 3fe7b8c

Please sign in to comment.