aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg-with-implicits/t6667b.scala
blob: db31c0a9be697014a07fae440abd1cb389d3d815 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
object Test {
  abstract class Box {
    val value: Int
  }

  implicit val a: Box = new Box {
    val value= 1
  }

  def main(args: Array[String]): Unit = {
    implicit val b: Box= new Box {
      val value= 2
    }

    new Object {
      new Test()
    }
    // compare with:
    new Test()
  }
}

class Test()(implicit x: Test.Box) {
  println(x.value)
}