From abbee9e28ef3f0150c9afa48f485ecc49e0e3787 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 1 Feb 2017 18:43:04 +1100 Subject: Update test file Updated with SI issues reported by Jason --- tests/neg/undet-classtag.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/neg/undet-classtag.scala b/tests/neg/undet-classtag.scala index 563596d14..dfe0eb2db 100644 --- a/tests/neg/undet-classtag.scala +++ b/tests/neg/undet-classtag.scala @@ -1,5 +1,27 @@ +import scala.reflect.ClassTag + object Test { def f[T: reflect.ClassTag](x: T) = ??? f(???) // error: undetermined ClassTag } + +// SI 9754 +object Program { + def test[T: ClassTag](x: T) = { + val arr = new Array[T](1) + println(arr.getClass) + println(x.getClass) + arr(0) = x + } + + def main(args: Array[String]): Unit = { + test(new Array[Nothing](0)) // error: undetermined ClassTag + } +} + +// SI 5353 +object t5353 { + if (false) Array("qwe") else Array() // error: undetermined ClassTag +} + -- cgit v1.2.3