Skip to content

Commit 683a772

Browse files
committed
Base decision whether to generate bridge on signatures
Was info before, but signatures already contain all the information we need and are cheaper to test for equality.
1 parent 32b8e60 commit 683a772

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/transform/Bridges.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
4545
* The bridge has the erased info of `other` and forwards to `member`.
4646
*/
4747
private def addBridgeIfNeeded(member: Symbol, other: Symbol) = {
48-
val otherInfo = erasure(other.info)
4948
def bridgeExists =
5049
bridgesScope.lookupAll(member.name).exists(bridge =>
51-
bridgeTarget(bridge) == member && bridge.info =:= otherInfo)
52-
if (!(member.is(Inline) || other.info =:= member.info || bridgeExists))
50+
bridgeTarget(bridge) == member && bridge.signature == other.signature)
51+
if (!(member.is(Inline) || member.signature == other.signature || bridgeExists))
5352
addBridge(member, other)
5453
}
5554

0 commit comments

Comments
 (0)