aboutsummaryrefslogblamecommitdiff
path: root/tests/run/t8197.scala
blob: b510f96f1b38b821f92b0b7f4ce845ca18f12f15 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                        
                       



               
                                             




                                                                           
// SI-8197, see also SI-4592 and SI-4728
class A
class B

class Foo(val x: A = null) {
  def this(bla: B*) = {
    this(new A)
  }
}

object Test extends dotty.runtime.LegacyApp {
  // 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)
}