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