summaryrefslogtreecommitdiff
path: root/test/files/run/trait-clonable.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/trait-clonable.scala')
-rw-r--r--test/files/run/trait-clonable.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/trait-clonable.scala b/test/files/run/trait-clonable.scala
new file mode 100644
index 0000000000..5be59d2586
--- /dev/null
+++ b/test/files/run/trait-clonable.scala
@@ -0,0 +1,11 @@
+// minimization of failure in run/t4813.scala related to the special
+// case for default methods that override methods owned by Object.class in
+// Java interfaces.
+trait C[A >: Null <: AnyRef] { override def clone(): A = null }
+trait X extends C[X]
+class D extends X { def foo = (this: X).clone() }
+object Test {
+ def main(args: Array[String]) {
+ assert(new D().foo == null)
+ }
+}