File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
3939 * before erasure, if the following conditions are satisfied.
4040 *
4141 * - `member` and other have different signatures
42- * - `member` is not inline
4342 * - there is not yet a bridge with the same name and signature in `root`
4443 *
4544 * The bridge has the erased info of `other` and forwards to `member`.
@@ -48,7 +47,7 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
4847 def bridgeExists =
4948 bridgesScope.lookupAll(member.name).exists(bridge =>
5049 bridgeTarget(bridge) == member && bridge.signature == other.signature)
51- if (! (member.is( Inline ) || member. signature == other.signature || bridgeExists))
50+ if (! (member.signature == other.signature || bridgeExists))
5251 addBridge(member, other)
5352 }
5453
Original file line number Diff line number Diff line change 1+ object Foo extends (Int => Int ) {
2+ inline def apply (x : Int ): Int = impl(x)
3+ def impl (x : Int ): Int = x + 1
4+ }
5+
6+ object Test {
7+
8+ def test (foo : Foo .type ): Int = foo(41 )
9+
10+ def test2 (f : Int => Int ): Int = f(41 )
11+
12+ def main (args : Array [String ]): Unit = {
13+ assert(test(Foo ) == 42 )
14+ assert(test2(Foo ) == 42 )
15+ }
16+
17+ }
You can’t perform that action at this time.
0 commit comments