File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/staging Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
76
76
tp match
77
77
case tp @ NamedType (NoPrefix , _) if level > levelOf(tp.symbol) => tp.symbol
78
78
case tp : NamedType if ! tp.symbol.isStatic => levelInconsistentRootOfPath(tp.prefix)
79
- case tp : ThisType if level > levelOf(tp.cls) => tp.cls
79
+ case tp : ThisType if level > levelOf(tp.cls) && ! tp.cls.isRefinementClass => tp.cls
80
80
case _ => NoSymbol
81
81
82
82
/** Try to heal reference to type `T` used in a higher level than its definition.
Original file line number Diff line number Diff line change
1
+ import scala .quoted .*
2
+
3
+ def fooImpl (using Quotes ): Expr [Any ] =
4
+ ' {
5
+ new AnyRef {
6
+ type T = Unit
7
+ def make : T = ()
8
+ def take (t : T ): Unit = ()
9
+ }: {
10
+ type T
11
+ def make : T
12
+ def take (t : T ): Unit
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments