File tree 4 files changed +16
-5
lines changed
compiler/src/dotty/tools/dotc
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -609,14 +609,20 @@ class Definitions {
609
609
lazy val QuotedExprType = ctx.requiredClassRef(" scala.quoted.Expr" )
610
610
def QuotedExprClass (implicit ctx : Context ) = QuotedExprType .symbol.asClass
611
611
612
- def QuotedExpr_~ (implicit ctx : Context ) = QuotedExprClass .requiredMethod(nme.UNARY_~ )
613
- def QuotedExpr_run (implicit ctx : Context ) = QuotedExprClass .requiredMethod(nme.run)
612
+ lazy val QuotedExpr_spliceR = QuotedExprClass .requiredMethod(nme.UNARY_~ )
613
+ def QuotedExpr_~ (implicit ctx : Context ) = QuotedExpr_spliceR .symbol
614
+ lazy val QuotedExpr_runR = QuotedExprClass .requiredMethodRef(nme.run)
615
+ def QuotedExpr_run (implicit ctx : Context ) = QuotedExpr_runR .symbol
614
616
615
617
lazy val QuotedTypeType = ctx.requiredClassRef(" scala.quoted.Type" )
616
618
def QuotedTypeClass (implicit ctx : Context ) = QuotedTypeType .symbol.asClass
617
619
618
- def QuotedType_~ (implicit ctx : Context ) =
619
- QuotedTypeClass .info.member(tpnme.UNARY_~ ).symbol.asType
620
+ lazy val QuotedType_spliceR = QuotedTypeClass .requiredType(tpnme.UNARY_~ ).typeRef
621
+ def QuotedType_~ = QuotedType_spliceR .symbol
622
+
623
+ lazy val QuotedTypeModule = QuotedTypeClass .companionModule
624
+ lazy val QuotedType_applyR = QuotedTypeModule .requiredMethodRef(nme.apply)
625
+ def QuotedType_apply (implicit ctx : Context ) = QuotedType_applyR .symbol
620
626
621
627
def Unpickler_unpickleExpr = ctx.requiredMethod(" scala.runtime.quoted.Unpickler.unpickleExpr" )
622
628
def Unpickler_unpickleType = ctx.requiredMethod(" scala.runtime.quoted.Unpickler.unpickleType" )
Original file line number Diff line number Diff line change @@ -313,6 +313,9 @@ object Denotations {
313
313
def requiredClass (name : PreName )(implicit ctx : Context ): ClassSymbol =
314
314
info.member(name.toTypeName).requiredSymbol(_.isClass).asClass
315
315
316
+ def requiredType (name : PreName )(implicit ctx : Context ): TypeSymbol =
317
+ info.member(name.toTypeName).requiredSymbol(_.isType).asType
318
+
316
319
/** The alternative of this denotation that has a type matching `targetType` when seen
317
320
* as a member of type `site`, `NoDenotation` if none exists.
318
321
*/
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import dotty.tools.dotc.core.quoted._
22
22
/** Translates quoted terms and types to `unpickle` method calls.
23
23
* Checks that the phase consistency principle (PCP) holds.
24
24
*/
25
- class ReifyQuotes extends MacroTransform {
25
+ class ReifyQuotes extends MacroTransformWithImplicits {
26
26
import ast .tpd ._
27
27
28
28
override def phaseName : String = " reifyQuotes"
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ abstract class Type[T] extends Quoted {
9
9
/** Some basic type tags, currently incomplete */
10
10
object Type {
11
11
12
+ implicit def apply [T ]: Type [T ] = ???
13
+
12
14
class TaggedPrimitive [T ] private [Type ] (implicit val ct : ClassTag [T ]) extends Type [T ]
13
15
14
16
implicit def UnitTag : Type [Unit ] = new TaggedPrimitive [Unit ]
You can’t perform that action at this time.
0 commit comments