Dotty Documentation

0.7.0-bin-SNAPSHOT

class Bridges
extends Object

A helper class for generating bridge methods in class root.

[-] Constructors

Bridges ( root: ClassSymbol )
Bridges ( implicit ctx: Context )

[-] Members

[+] private class BridgesCursor
[+] private val bridgeTarget : MutableSymbolMap [ Symbol ]
[+] private val bridges : ListBuffer [ Tree ]
[+] private val bridgesScope : MutableScope
[+] private implicit val ctx : Context
[+] private val elimErasedCtx : Context
[+] private val preErasureCtx : Context
[+] private val root : ClassSymbol
[+] private var toBeRemoved : Set [ Symbol ]
[+] def add ( stats: List [ Tree ] ) : List [ Tree ]

Add all necessary bridges to template statements stats, and remove at the same time deferred methods in stats that are replaced by a bridge with the same signature.

[+] private def addBridge ( member: Symbol , other: Symbol ) : ListBuffer [ Tree ]

Generate bridge between member and other

[+] private def addBridgeIfNeeded ( member: Symbol , other: Symbol ) : Any

Add a bridge between member and other, where member overrides other before erasure, if the following conditions are satisfied.

  • member and other have different signatures
  • there is not yet a bridge with the same name and signature in root.

The bridge has the erased info of other and forwards to member. Additionally, if member and other do have the same signature, but not the same type after erasure and before elimErasedValueTypes issue an error: A bridge would be needed yet it would clash with the member itself. See neg/i1905.scala

[+] def bridgePosFor ( member: Symbol ) : Position