File: t6443c.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (21 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
trait A {
  type D >: Null <: C
  def foo(d: D)(a: Any, d2: d.type): Unit
  trait C {
    def bar: Unit = foo(null)(null, null)
  }
}
object B extends A {
  class D extends C

  def foo(d: D)(a: Any, d2: d.type): Unit = () // Bridge method required here!

  // No bridge method should be added, but we'll be happy enough if
  // the "same type after erasure" error kicks in before the duplicated
  // bridge causes a problem.
  def foo(d: D)(a: Any)(d2: d.type): Unit = ()
}

object Test extends App {
  new B.D().bar
}