File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import SymUtils._
1010import Symbols ._
1111import SymDenotations ._
1212import Types ._
13+ import Periods ._
1314import Decorators ._
1415import DenotTransformers ._
1516import StdNames ._
@@ -146,6 +147,7 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase =>
146147 // !decl.isClass avoids forcing nested traits, preventing cycles
147148 if ! decl.isClass && needsTraitSetter(decl) then
148149 val setter = makeTraitSetter(decl.asTerm)
150+ setter.validFor = thisPhase.validFor // validity of setter = next phase up to next transformer afterwards
149151 decls1.enter(setter)
150152 modified = true
151153 if modified then
Original file line number Diff line number Diff line change 1+ @ main def Test = println(example.Trait .get)
Original file line number Diff line number Diff line change 1+ // Trait.scala
2+ package example
3+
4+ import quoted ._
5+
6+ trait Trait {
7+ implicit val foo : Int = 23
8+ }
9+
10+ object Trait {
11+ inline def get : Trait = $ { getImpl }
12+
13+ def getImpl (using Quotes ): Expr [Trait ] = ' { new Trait {} }
14+ }
You can’t perform that action at this time.
0 commit comments