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.
276276 /** Are we in a transparent method body? */
277277 def inTransparentMethod = owner.ownersIterator.exists(_.isTransparentMethod)
278278
279+ /** Are we in a transparent method body? */
280+ def inErasedTransparentMethod = owner.ownersIterator.exists(sym =>
281+ sym.isTransparentMethod && sym.is(Erased ))
282+
279283 /** Is `feature` enabled in class `owner`?
280284 * This is the case if one of the following two alternatives holds:
281285 *
Original file line number Diff line number Diff line change @@ -58,8 +58,12 @@ object Inliner {
5858 /** Should call with method `meth` be inlined in this context? */
5959 def isInlineable (meth : Symbol )(implicit ctx : Context ): Boolean = {
6060
61+ /** Suppress inlining of
62+ * - non-erased methods inside a transparent method,
63+ * - all methods inside an erased transparent method
64+ */
6165 def suppressInline =
62- ctx.inTransparentMethod ||
66+ ctx.inTransparentMethod && ( ! meth.is( Erased ) || ctx.inErasedTransparentMethod) ||
6367 ctx.settings.YnoInline .value ||
6468 ctx.isAfterTyper ||
6569 ctx.reporter.hasErrors
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ object Test {
77 System .out.println(2 * x)
88 }
99 }
10+
1011}
1112
1213class Unrolled (arr : Array [Int ]) extends AnyVal {
You can’t perform that action at this time.
0 commit comments