aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-01 17:18:13 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-01 17:48:32 +1100
commite34555f69e7cdd6d19d0d1ed969127f4ee65c36e (patch)
tree9b3011bf3074f1d1d8e7d815814b8ed370d98639 /tests/pos
parentb11e6d678a92187e5e9f821ba1116cec2cce0f8c (diff)
downloaddotty-e34555f69e7cdd6d19d0d1ed969127f4ee65c36e.tar.gz
dotty-e34555f69e7cdd6d19d0d1ed969127f4ee65c36e.tar.bz2
dotty-e34555f69e7cdd6d19d0d1ed969127f4ee65c36e.zip
Disallow taking a class tag of Nothing or Null.
It seems in most cases this leads to weird behavior and cause confusing error messages later. It also means we cannot create an Array[Nothing], except by passing the classtag explicitly.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/t3859.scala2
-rw-r--r--tests/pos/t5859.scala4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/pos/t3859.scala b/tests/pos/t3859.scala
index 992207301..486c1d4b2 100644
--- a/tests/pos/t3859.scala
+++ b/tests/pos/t3859.scala
@@ -1,4 +1,4 @@
class Test {
- def foo: Unit = bar(Array(): _*)
+ def foo: Unit = bar(Array[AnyRef](): _*)
def bar(values: AnyRef*): Unit = ()
}
diff --git a/tests/pos/t5859.scala b/tests/pos/t5859.scala
index 2a31e68ee..60ec8b4cb 100644
--- a/tests/pos/t5859.scala
+++ b/tests/pos/t5859.scala
@@ -7,9 +7,9 @@ class A {
f(List[AnyRef](): _*)
f(List(): _*)
f(Nil: _*)
- f(Array(): _*)
+ // f(Array(): _*) // undetermined ClassTag
f(Array[AnyRef](): _*)
f(List(1))
f(List(1), Nil: _*)
- f(List(1), Array(): _*)
+ // f(List(1), Array(): _*) // undetermined ClassTag
}