Skip to content

Commit 27380d1

Browse files
committed
Only expand fully applied methods
1 parent 530a661 commit 27380d1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ class Inlining extends MacroTransform {
5454
else super.transform(tree)
5555
case _: Typed | _: Block =>
5656
super.transform(tree)
57-
case _ if Inliner.isInlineable(tree) =>
58-
val inlined = Inliner.inlineCall(tree)
59-
transform(inlined)
57+
case _ if Inliner.isInlineable(tree) && !tree.tpe.widen.isInstanceOf[MethodOrPoly] =>
58+
val tree1 = super.transform(tree)
59+
val inlined = Inliner.inlineCall(tree1)
60+
inlined
6061
case _ =>
6162
super.transform(tree)
6263

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CompilationTests {
3939
compileFilesInDir("tests/new", defaultOptions),
4040
compileFilesInDir("tests/pos-scala2", scala2CompatMode),
4141
compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-Yerased-terms")),
42-
compileFilesInDir("tests/pos", defaultOptions),
42+
compileFilesInDir("tests/pos", defaultOptions /*and "-Yinline-blackbox-after-typer"*/),
4343
compileFilesInDir("tests/pos-deep-subtype", allowDeepSubtypes),
4444
compileFile(
4545
// succeeds despite -Xfatal-warnings because of -nowarn

0 commit comments

Comments
 (0)