aboutsummaryrefslogblamecommitdiff
path: root/tests/pending/run/t8197.scala
blob: 27212cbbd3c2cf18c87b5b315f3398ed7f001b96 (plain) (tree)
1
2
3
4
5
6




                                        
                       









                                                                           
// 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 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)
}