File tree 2 files changed +16
-4
lines changed
compiler/src/dotty/tools/dotc/inlines
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -567,9 +567,8 @@ class Inliner(val call: tpd.Tree)(using Context):
567
567
case t : TypeRef => paramProxy.getOrElse(t, mapOver(t))
568
568
case t : TermRef if t.symbol.isImport =>
569
569
val ImportType (e) = t.widenTermRefExpr: @ unchecked
570
- paramProxy.get(e.tpe) match
571
- case Some (p) => newImportSymbol(ctx.owner, singleton(p)).termRef
572
- case None => mapOver(t)
570
+ val e1 = singleton(apply(e.tpe))
571
+ newImportSymbol(ctx.owner, e1).termRef
573
572
case t : SingletonType =>
574
573
if t.termSymbol.isAllOf(InlineParam ) then apply(t.widenTermRefExpr)
575
574
else paramProxy.getOrElse(t, mapOver(t))
Original file line number Diff line number Diff line change @@ -22,8 +22,21 @@ object Minimization:
22
22
23
23
inline def foo (x : GivesString ): Unit =
24
24
import x .aString
25
- summon[String ]
25
+ summon[String ] // ok
26
26
summonInline[String ] // was error
27
27
28
28
foo(??? )
29
+
30
+
31
+ trait A :
32
+ val x : GivesString
33
+
34
+ inline def bar : Unit =
35
+ import this .x .aString
36
+ summon[String ] // ok
37
+ summonInline[String ] // was error
38
+
39
+ val a : A = ???
40
+ a.bar
41
+
29
42
end Minimization
You can’t perform that action at this time.
0 commit comments