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:
125
125
}
126
126
127
127
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)
129
131
130
132
/** Implementation of Types#simplified */
131
133
def simplify(tp: Type, theMap: SimplifyMap | Null)(using Context): Type = {
Original file line number Diff line number Diff line change 29
29
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazylist.scala:41:42 -------------------------------------
30
30
41 | val ref4c: LazyList[Int]^{cap1, ref3} = ref4 // error
31
31
| ^^^^
32
- | Found: (ref4 : lazylists.LazyList[Int]^{cap3, ref1, ref2 })
32
+ | Found: (ref4 : lazylists.LazyList[Int]^{cap3, cap1, cap2 })
33
33
| Required: lazylists.LazyList[Int]^{cap1, ref3}
34
34
|
35
35
| longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change 4
4
|object creation impossible, since def apply(fa: String): Int in trait XX in object Test3 is not defined
5
5
|(Note that
6
6
| 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
8
8
| )
9
9
-- Error: tests/neg/6314-6.scala:52:3 ----------------------------------------------------------------------------------
10
10
52 | (new YY {}).boom // error: object creation impossible
11
11
| ^
12
12
|object creation impossible, since def apply(fa: String): Int in trait XX in object Test4 is not defined
13
13
|(Note that
14
14
| 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
16
16
| )
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