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) {
39
39
* before erasure, if the following conditions are satisfied.
40
40
*
41
41
* - `member` and other have different signatures
42
- * - `member` is not inline
43
42
* - there is not yet a bridge with the same name and signature in `root`
44
43
*
45
44
* The bridge has the erased info of `other` and forwards to `member`.
@@ -48,7 +47,7 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
48
47
def bridgeExists =
49
48
bridgesScope.lookupAll(member.name).exists(bridge =>
50
49
bridgeTarget(bridge) == member && bridge.signature == other.signature)
51
- if (! (member.is( Inline ) || member. signature == other.signature || bridgeExists))
50
+ if (! (member.signature == other.signature || bridgeExists))
52
51
addBridge(member, other)
53
52
}
54
53
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