diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/files/pos/manifest1.scala | 20 | ||||
-rw-r--r-- | test/pending/neg/t0513.scala | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/files/pos/manifest1.scala b/test/files/pos/manifest1.scala new file mode 100755 index 0000000000..4d3b3bfa48 --- /dev/null +++ b/test/files/pos/manifest1.scala @@ -0,0 +1,20 @@ +import scala.reflect.Manifest + +object Test { + def foo[T](x: T)(implicit m: Manifest[T]) { + foo(List(x)) + } + foo(1) + foo("abc") + foo(List(1, 2, 3)) + val x: List[Int] with Ordered[List[Int]] = null + foo(x) + foo[x.type](x) + abstract class C { type T = String; val x: T } + val c = new C { val x = "abc" } + foo(c.x) + abstract class D { type T; val x: T } + val d: D = new D { type T = String; val x = "x" } + foo(d.x) + +} diff --git a/test/pending/neg/t0513.scala b/test/pending/neg/t0513.scala new file mode 100644 index 0000000000..0082b0e563 --- /dev/null +++ b/test/pending/neg/t0513.scala @@ -0,0 +1,6 @@ +object Test { + case class Y[T1, T2 <: T1] + //val test = Y[Nothing, Int] // Compiler error + case class Test[T] + val test2 = Test[Y[Nothing, Int]] // No error +} |