summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-25 12:44:47 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-25 12:44:47 -0800
commitb4ff1e934f36af6792b29b3d850cee836aa7b050 (patch)
tree603b1903787eeee909ce9bfa6d867df66f36a7e4 /test
parentec4479aa7d0279daa701481fb7d77c1f43617190 (diff)
parenta5cd601dacb94d65ba035f5ca9fd3c2064668b70 (diff)
downloadscala-b4ff1e934f36af6792b29b3d850cee836aa7b050.tar.gz
scala-b4ff1e934f36af6792b29b3d850cee836aa7b050.tar.bz2
scala-b4ff1e934f36af6792b29b3d850cee836aa7b050.zip
Merge pull request #3583 from adriaanm/t8197
SI-8197 clarify overloading resolution with default args
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t8197.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/files/run/t8197.scala b/test/files/run/t8197.scala
index 5ca67088de..910a3ebc83 100644
--- a/test/files/run/t8197.scala
+++ b/test/files/run/t8197.scala
@@ -1,7 +1,7 @@
-// NOTE: according to SI-4728, this shouldn't even compile...
+// SI-8197, see also SI-4592 and SI-4728
class A
class B
-// default arguments do not participate in overload resolution
+
class Foo(val x: A = null) {
def this(bla: B*) {
this(new A)
@@ -9,5 +9,8 @@ class Foo(val x: A = null) {
}
object Test extends App {
+ // both constructors of `Foo` are applicable. Overloading resolution
+ // will eliminate the alternative that uses a default argument, therefore
+ // the vararg constructor is chosen.
assert((new Foo).x != null)
}