File tree Expand file tree Collapse file tree 6 files changed +39
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 6 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ object TypeOps:
125125 }
126126
127127 def isLegalPrefix (pre : Type )(using Context ): Boolean =
128- pre.isStable
128+ // isLegalPrefix is relaxed after typer unless we're doing an implicit
129+ // search (this matters when doing summonInline in an inline def like in tests/pos/i17222.8.scala).
130+ pre.isStable || ! ctx.phase.isTyper && ctx.mode.is(Mode .ImplicitsEnabled )
129131
130132 /** Implementation of Types#simplified */
131133 def simplify (tp : Type , theMap : SimplifyMap | Null )(using Context ): Type = {
Original file line number Diff line number Diff line change 2929-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazylist.scala:41:42 -------------------------------------
303041 | val ref4c: LazyList[Int]^{cap1, ref3} = ref4 // error
3131 | ^^^^
32- | Found: (ref4 : lazylists.LazyList[Int]^{cap3, ref1, ref2 })
32+ | Found: (ref4 : lazylists.LazyList[Int]^{cap3, cap1, cap2 })
3333 | Required: lazylists.LazyList[Int]^{cap1, ref3}
3434 |
3535 | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change 44 |object creation impossible, since def apply(fa: String): Int in trait XX in object Test3 is not defined
55 |(Note that
66 | parameter String in def apply(fa: String): Int in trait XX in object Test3 does not match
7- | parameter Test3.Bar[X & (X & Y) ] in def apply(fa: Test3.Bar[X & YY.this.Foo]): Test3.Bar[Y & YY.this.Foo] in trait YY in object Test3
7+ | parameter Test3.Bar[X & Object with Test3.YY {...}#Foo ] in def apply(fa: Test3.Bar[X & YY.this.Foo]): Test3.Bar[Y & YY.this.Foo] in trait YY in object Test3
88 | )
99-- Error: tests/neg/6314-6.scala:52:3 ----------------------------------------------------------------------------------
101052 | (new YY {}).boom // error: object creation impossible
1111 | ^
1212 |object creation impossible, since def apply(fa: String): Int in trait XX in object Test4 is not defined
1313 |(Note that
1414 | parameter String in def apply(fa: String): Int in trait XX in object Test4 does not match
15- | parameter Test4.Bar[X & (X & Y) ] in def apply(fa: Test4.Bar[X & YY.this.FooAlias]): Test4.Bar[Y & YY.this.FooAlias] in trait YY in object Test4
15+ | parameter Test4.Bar[X & Object with Test4.YY {...}#FooAlias ] in def apply(fa: Test4.Bar[X & YY.this.FooAlias]): Test4.Bar[Y & YY.this.FooAlias] in trait YY in object Test4
1616 | )
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+
Original file line number Diff line number Diff line change 1+ package example
2+
3+ trait Example {
4+ class Input
5+
6+ type Output [A ] = A match {
7+ case Input => Int
8+ }
9+ }
10+
11+ class Ref (ref : Example # Input )
You can’t perform that action at this time.
0 commit comments