File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -609,14 +609,20 @@ class Definitions {
609609 lazy val QuotedExprType = ctx.requiredClassRef(" scala.quoted.Expr" )
610610 def QuotedExprClass (implicit ctx : Context ) = QuotedExprType .symbol.asClass
611611
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
614616
615617 lazy val QuotedTypeType = ctx.requiredClassRef(" scala.quoted.Type" )
616618 def QuotedTypeClass (implicit ctx : Context ) = QuotedTypeType .symbol.asClass
617619
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
620626
621627 def Unpickler_unpickleExpr = ctx.requiredMethod(" scala.runtime.quoted.Unpickler.unpickleExpr" )
622628 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 {
313313 def requiredClass (name : PreName )(implicit ctx : Context ): ClassSymbol =
314314 info.member(name.toTypeName).requiredSymbol(_.isClass).asClass
315315
316+ def requiredType (name : PreName )(implicit ctx : Context ): TypeSymbol =
317+ info.member(name.toTypeName).requiredSymbol(_.isType).asType
318+
316319 /** The alternative of this denotation that has a type matching `targetType` when seen
317320 * as a member of type `site`, `NoDenotation` if none exists.
318321 */
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import dotty.tools.dotc.core.quoted._
2222/** Translates quoted terms and types to `unpickle` method calls.
2323 * Checks that the phase consistency principle (PCP) holds.
2424 */
25- class ReifyQuotes extends MacroTransform {
25+ class ReifyQuotes extends MacroTransformWithImplicits {
2626 import ast .tpd ._
2727
2828 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 {
99/** Some basic type tags, currently incomplete */
1010object Type {
1111
12+ implicit def apply [T ]: Type [T ] = ???
13+
1214 class TaggedPrimitive [T ] private [Type ] (implicit val ct : ClassTag [T ]) extends Type [T ]
1315
1416 implicit def UnitTag : Type [Unit ] = new TaggedPrimitive [Unit ]
You can’t perform that action at this time.
0 commit comments