Skip to content

Commit abbee9e

Browse files
committed
Update test file
Updated with SI issues reported by Jason
1 parent 029c6aa commit abbee9e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/neg/undet-classtag.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1+
import scala.reflect.ClassTag
2+
13
object Test {
24
def f[T: reflect.ClassTag](x: T) = ???
35

46
f(???) // error: undetermined ClassTag
57
}
8+
9+
// SI 9754
10+
object Program {
11+
def test[T: ClassTag](x: T) = {
12+
val arr = new Array[T](1)
13+
println(arr.getClass)
14+
println(x.getClass)
15+
arr(0) = x
16+
}
17+
18+
def main(args: Array[String]): Unit = {
19+
test(new Array[Nothing](0)) // error: undetermined ClassTag
20+
}
21+
}
22+
23+
// SI 5353
24+
object t5353 {
25+
if (false) Array("qwe") else Array() // error: undetermined ClassTag
26+
}
27+

0 commit comments

Comments
 (0)