File tree 3 files changed +17
-0
lines changed
compiler/src/dotty/tools/dotc/transform
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import SymUtils._
10
10
import Symbols ._
11
11
import SymDenotations ._
12
12
import Types ._
13
+ import Periods ._
13
14
import Decorators ._
14
15
import DenotTransformers ._
15
16
import StdNames ._
@@ -146,6 +147,7 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase =>
146
147
// !decl.isClass avoids forcing nested traits, preventing cycles
147
148
if ! decl.isClass && needsTraitSetter(decl) then
148
149
val setter = makeTraitSetter(decl.asTerm)
150
+ setter.validFor = Period (ctx.runId, thisPhase.next.id, decl.validFor.lastPhaseId)
149
151
decls1.enter(setter)
150
152
modified = true
151
153
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