aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/overloadedAccess.scala
blob: a2d72f583ea23622982e31bd18747b6633d3b7c3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                   
object overloadedAccess {

  trait ST {
    def f(x: Object): Int = 1
    def f(x: Int): Unit = ()
  }

  object O extends ST {
    def f(x: String): Unit = ()
  }

  class C extends ST {
    import O._       // needs to pick inherited member because they are made visible in same scope.
    val x = f("abc")
    val y: Int = x
  }

}