diff options
-rw-r--r-- | src/library/scala/AnyVal.scala | 2 | ||||
-rw-r--r-- | src/library/scala/NotNull.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/tpe/TypeComparers.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t0764.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t3977.check | 2 | ||||
-rw-r--r-- | test/files/neg/t3977.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t3108.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t3417.scala | 11 | ||||
-rw-r--r-- | test/files/run/t6646.check | 2 | ||||
-rw-r--r-- | test/files/run/t6646.scala | 6 |
10 files changed, 15 insertions, 29 deletions
diff --git a/src/library/scala/AnyVal.scala b/src/library/scala/AnyVal.scala index 0d6ba2454c..9def6cb054 100644 --- a/src/library/scala/AnyVal.scala +++ b/src/library/scala/AnyVal.scala @@ -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 } diff --git a/src/library/scala/NotNull.scala b/src/library/scala/NotNull.scala index f87416b49d..3cbe9ed4ac 100644 --- a/src/library/scala/NotNull.scala +++ b/src/library/scala/NotNull.scala @@ -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 {} diff --git a/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala b/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala index 2248d9bbfb..863d2109df 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeComparers.scala @@ -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, _) => diff --git a/test/files/neg/t0764.scala b/test/files/neg/t0764.scala index 9aebe04b79..f2cc65cf7d 100644 --- a/test/files/neg/t0764.scala +++ b/test/files/neg/t0764.scala @@ -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 ) } diff --git a/test/files/neg/t3977.check b/test/files/neg/t3977.check index 9da118ee91..72335a0926 100644 --- a/test/files/neg/t3977.check +++ b/test/files/neg/t3977.check @@ -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 diff --git a/test/files/neg/t3977.scala b/test/files/neg/t3977.scala index f55a832c52..11a8cdba4b 100644 --- a/test/files/neg/t3977.scala +++ b/test/files/neg/t3977.scala @@ -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 -}
\ No newline at end of file + new NoNull +} diff --git a/test/files/pos/t3108.scala b/test/files/pos/t3108.scala deleted file mode 100644 index 6a1da73220..0000000000 --- a/test/files/pos/t3108.scala +++ /dev/null @@ -1,5 +0,0 @@ -object A { - val a: NotNull = "" - val b: NotNull = 41 -} - diff --git a/test/files/pos/t3417.scala b/test/files/pos/t3417.scala deleted file mode 100644 index d2de1608aa..0000000000 --- a/test/files/pos/t3417.scala +++ /dev/null @@ -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 diff --git a/test/files/run/t6646.check b/test/files/run/t6646.check index b0b7ad32f3..15715dae91 100644 --- a/test/files/run/t6646.check +++ b/test/files/run/t6646.check @@ -1,4 +1,4 @@ -Found NotNull +Found NoNull Found lower Found 2 A single ident is always a pattern diff --git a/test/files/run/t6646.scala b/test/files/run/t6646.scala index 150b0df11e..a377ac274e 100644 --- a/test/files/run/t6646.scala +++ b/test/files/run/t6646.scala @@ -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) |