File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1859,7 +1859,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1859
1859
if (folded ne tree) return adaptConstant(folded, folded.tpe.asInstanceOf [ConstantType ])
1860
1860
// drop type if prototype is Unit
1861
1861
if (pt isRef defn.UnitClass )
1862
- return adapt(tpd.Block (tree :: Nil , Literal (Constant (()))), pt)
1862
+ // local adaptation makes sure every adapted tree conforms to its pt
1863
+ // so will take the code path that decides on inlining
1864
+ return tpd.Block (adapt(tree, WildcardType ) :: Nil , Literal (Constant (())))
1863
1865
// convert function literal to SAM closure
1864
1866
tree match {
1865
1867
case Closure (Nil , id @ Ident (nme.ANON_FUN ), _)
You can’t perform that action at this time.
0 commit comments