From 32fedbb1c54dd6ba352e1ef84eddcd5e86da70e8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 26 Jun 2019 13:43:09 +0200 Subject: [PATCH] Miscellaneous tests These came from trials of bug reports that have been closed. --- tests/pos/i6670.scala | 13 +++++++++++++ tests/pos/t11593.check | 1 + tests/pos/t11593/Properties.scala | 2 ++ tests/pos/t11593/Test.scala | 10 ++++++++++ 4 files changed, 26 insertions(+) create mode 100644 tests/pos/i6670.scala create mode 100644 tests/pos/t11593.check create mode 100644 tests/pos/t11593/Properties.scala create mode 100644 tests/pos/t11593/Test.scala diff --git a/tests/pos/i6670.scala b/tests/pos/i6670.scala new file mode 100644 index 000000000000..aea7deed573c --- /dev/null +++ b/tests/pos/i6670.scala @@ -0,0 +1,13 @@ +case class X[A]( + foo: A, + bar: String = "" +) { + def copy[A]( + foo: A = foo, + bar: String = bar + ): X[A] = ??? +} +object Test { + val x = X(1) + x.copy(bar = "BAZ") +} \ No newline at end of file diff --git a/tests/pos/t11593.check b/tests/pos/t11593.check new file mode 100644 index 000000000000..1fb570a95b8c --- /dev/null +++ b/tests/pos/t11593.check @@ -0,0 +1 @@ +java.util.Properties diff --git a/tests/pos/t11593/Properties.scala b/tests/pos/t11593/Properties.scala new file mode 100644 index 000000000000..1dcf019f23cb --- /dev/null +++ b/tests/pos/t11593/Properties.scala @@ -0,0 +1,2 @@ +package foo +class Properties \ No newline at end of file diff --git a/tests/pos/t11593/Test.scala b/tests/pos/t11593/Test.scala new file mode 100644 index 000000000000..9ef8533b2942 --- /dev/null +++ b/tests/pos/t11593/Test.scala @@ -0,0 +1,10 @@ +package foo { + import java.util._ + object X { + def bar(x: Properties): Unit = println(x.getClass.getName) + bar(new Properties) + } +} +object Test extends App { + foo.X +} \ No newline at end of file