File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,12 @@ object TypeOps:
125125 }
126126
127127 def isLegalPrefix (pre : Type )(using Context ): Boolean =
128+ // This used to be `pre.isStable || !ctx.phase.isTyper` but the latter
129+ // condition was dropped in #21954 to make implicit search during the
130+ // inlining phase behave more like implicit search during the typer phase.
131+ // However, this change has lead to retyping issues (#23423) and I suspect
132+ // other issues could crop up as we might end up calling asSeenFrom with a
133+ // widened prefix in various situations post-typer.
128134 pre.isStable
129135
130136 /** Implementation of Types#simplified */
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
3232 */
3333 def apply (tp : Type ): Type =
3434 tp match
35- case NonSpliceAlias (aliased) => this .apply(aliased)
35+ case NonSpliceAlias (aliased) =>
36+ val aliased1 = aliased
37+ if aliased1 ne aliased then aliased1
38+ else tp
3639 case tp : TypeRef => healTypeRef(tp)
3740 case tp : TermRef =>
3841 val inconsistentRoot = levelInconsistentRootOfPath(tp)
Original file line number Diff line number Diff line change 1+ package pkg
2+
3+ import scala .quoted .*
4+
5+ trait HasElem {
6+ type Elem
7+ type Alias = Elem
8+ }
9+
10+ object Macro :
11+ inline def foo : Unit = $ {fooImpl}
12+ def fooImpl (using Quotes ): Expr [Unit ] =
13+ ' {
14+ val lll : (he : HasElem ) => he.Alias =
15+ (hx : HasElem ) => ???
16+ }
Original file line number Diff line number Diff line change 1+ object Test :
2+ def test : Unit = pkg.Macro .foo
3+ // used to be error:
4+ // Found: (hx: pkg.HasElem) => hx.Elem
5+ // Required: (he: pkg.HasElem) => he.Elem
6+
You can’t perform that action at this time.
0 commit comments