diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/implicit-classes.scala | 17 | ||||
-rw-r--r-- | test/pending/run/t5629.check | 2 | ||||
-rw-r--r-- | test/pending/run/t5629.scala | 25 | ||||
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.check | 0 | ||||
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.flags | 1 | ||||
-rw-r--r-- | test/pending/run/virtpatmat_anonfun_underscore.scala | 4 |
6 files changed, 49 insertions, 0 deletions
diff --git a/test/pending/run/implicit-classes.scala b/test/pending/run/implicit-classes.scala new file mode 100644 index 0000000000..02b74de2b0 --- /dev/null +++ b/test/pending/run/implicit-classes.scala @@ -0,0 +1,17 @@ +object O { + implicit class C(s: String) { + def twice = s + s + } +} + +/** +// +// We'd like to augment object O in Namers so that it also has an implicit method +object O { + implicit class C(s: String) { + def twice = s + s + } + implicit def C(s: String): C = new C(s) +} + +**/ diff --git a/test/pending/run/t5629.check b/test/pending/run/t5629.check new file mode 100644 index 0000000000..6a2d630f4e --- /dev/null +++ b/test/pending/run/t5629.check @@ -0,0 +1,2 @@ +int child got: 33 +any child got: 33 diff --git a/test/pending/run/t5629.scala b/test/pending/run/t5629.scala new file mode 100644 index 0000000000..28e74a1c94 --- /dev/null +++ b/test/pending/run/t5629.scala @@ -0,0 +1,25 @@ +import scala.{specialized => spec} + +trait GrandParent[@spec(Int) -A] { + def foo(a:A): Unit + def bar[B <: A](b:B): Unit = println("grandparent got: %s" format b) +} + +trait Parent[@spec(Int) -A] extends GrandParent[A] { + def foo(a:A) = bar(a) +} + +class IntChild extends Parent[Int] { + override def bar[B <: Int](b:B): Unit = println("int child got: %s" format b) +} + +class AnyChild extends Parent[Any] { + override def bar[B <: Any](b:B): Unit = println("any child got: %s" format b) +} + +object Test { + def main(args:Array[String]) { + new IntChild().foo(33) + new AnyChild().foo(33) + } +} diff --git a/test/pending/run/virtpatmat_anonfun_underscore.check b/test/pending/run/virtpatmat_anonfun_underscore.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.check diff --git a/test/pending/run/virtpatmat_anonfun_underscore.flags b/test/pending/run/virtpatmat_anonfun_underscore.flags new file mode 100644 index 0000000000..23e3dc7d26 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.flags @@ -0,0 +1 @@ +-Yvirtpatmat
\ No newline at end of file diff --git a/test/pending/run/virtpatmat_anonfun_underscore.scala b/test/pending/run/virtpatmat_anonfun_underscore.scala new file mode 100644 index 0000000000..db6705d025 --- /dev/null +++ b/test/pending/run/virtpatmat_anonfun_underscore.scala @@ -0,0 +1,4 @@ +object Test extends App { + List(1,2,3) map (_ match { case x => x + 1} ) // `_ match` is redundant but shouldn't crash the compiler + List((1,2)) map (_ match { case (x, z) => x + z}) +}
\ No newline at end of file |