File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,10 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
276
276
/** Are we in a transparent method body? */
277
277
def inTransparentMethod = owner.ownersIterator.exists(_.isTransparentMethod)
278
278
279
+ /** Are we in a transparent method body? */
280
+ def inErasedTransparentMethod = owner.ownersIterator.exists(sym =>
281
+ sym.isTransparentMethod && sym.is(Erased ))
282
+
279
283
/** Is `feature` enabled in class `owner`?
280
284
* This is the case if one of the following two alternatives holds:
281
285
*
Original file line number Diff line number Diff line change @@ -58,8 +58,12 @@ object Inliner {
58
58
/** Should call with method `meth` be inlined in this context? */
59
59
def isInlineable (meth : Symbol )(implicit ctx : Context ): Boolean = {
60
60
61
+ /** Suppress inlining of
62
+ * - non-erased methods inside a transparent method,
63
+ * - all methods inside an erased transparent method
64
+ */
61
65
def suppressInline =
62
- ctx.inTransparentMethod ||
66
+ ctx.inTransparentMethod && ( ! meth.is( Erased ) || ctx.inErasedTransparentMethod) ||
63
67
ctx.settings.YnoInline .value ||
64
68
ctx.isAfterTyper ||
65
69
ctx.reporter.hasErrors
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ object Test {
7
7
System .out.println(2 * x)
8
8
}
9
9
}
10
+
10
11
}
11
12
12
13
class Unrolled (arr : Array [Int ]) extends AnyVal {
You can’t perform that action at this time.
0 commit comments