Skip to content

Commit 9294593

Browse files
Merge pull request #9672 from dotty-staging/update-Unliftable-API
Update Unliftable API
2 parents a1732c2 + 3f4f665 commit 9294593

File tree

12 files changed

+293
-232
lines changed

12 files changed

+293
-232
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -791,15 +791,15 @@ class Definitions {
791791
@tu lazy val QuoteContextClass: ClassSymbol = requiredClass("scala.quoted.QuoteContext")
792792

793793
@tu lazy val LiftableModule: Symbol = requiredModule("scala.quoted.Liftable")
794-
@tu lazy val LiftableModule_BooleanIsLiftable: Symbol = LiftableModule.requiredMethod("BooleanIsLiftable")
795-
@tu lazy val LiftableModule_ByteIsLiftable: Symbol = LiftableModule.requiredMethod("ByteIsLiftable")
796-
@tu lazy val LiftableModule_ShortIsLiftable: Symbol = LiftableModule.requiredMethod("ShortIsLiftable")
797-
@tu lazy val LiftableModule_IntIsLiftable: Symbol = LiftableModule.requiredMethod("IntIsLiftable")
798-
@tu lazy val LiftableModule_LongIsLiftable: Symbol = LiftableModule.requiredMethod("LongIsLiftable")
799-
@tu lazy val LiftableModule_FloatIsLiftable: Symbol = LiftableModule.requiredMethod("FloatIsLiftable")
800-
@tu lazy val LiftableModule_DoubleIsLiftable: Symbol = LiftableModule.requiredMethod("DoubleIsLiftable")
801-
@tu lazy val LiftableModule_CharIsLiftable: Symbol = LiftableModule.requiredMethod("CharIsLiftable")
802-
@tu lazy val LiftableModule_StringIsLiftable: Symbol = LiftableModule.requiredMethod("StringIsLiftable")
794+
@tu lazy val LiftableModule_BooleanLiftable: Symbol = LiftableModule.requiredMethod("BooleanLiftable")
795+
@tu lazy val LiftableModule_ByteLiftable: Symbol = LiftableModule.requiredMethod("ByteLiftable")
796+
@tu lazy val LiftableModule_ShortLiftable: Symbol = LiftableModule.requiredMethod("ShortLiftable")
797+
@tu lazy val LiftableModule_IntLiftable: Symbol = LiftableModule.requiredMethod("IntLiftable")
798+
@tu lazy val LiftableModule_LongLiftable: Symbol = LiftableModule.requiredMethod("LongLiftable")
799+
@tu lazy val LiftableModule_FloatLiftable: Symbol = LiftableModule.requiredMethod("FloatLiftable")
800+
@tu lazy val LiftableModule_DoubleLiftable: Symbol = LiftableModule.requiredMethod("DoubleLiftable")
801+
@tu lazy val LiftableModule_CharLiftable: Symbol = LiftableModule.requiredMethod("CharLiftable")
802+
@tu lazy val LiftableModule_StringLiftable: Symbol = LiftableModule.requiredMethod("StringLiftable")
803803

804804
@tu lazy val InternalQuotedModule: Symbol = requiredModule("scala.internal.quoted.CompileTime")
805805
@tu lazy val InternalQuoted_exprQuote : Symbol = InternalQuotedModule.requiredMethod("exprQuote")

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ class ReifyQuotes extends MacroTransform {
150150
lit.const.tag match {
151151
case Constants.NullTag => ref(defn.InternalQuotedExpr_null)
152152
case Constants.UnitTag => ref(defn.InternalQuotedExpr_unit)
153-
case Constants.BooleanTag => liftedValue(defn.LiftableModule_BooleanIsLiftable)
154-
case Constants.ByteTag => liftedValue(defn.LiftableModule_ByteIsLiftable)
155-
case Constants.ShortTag => liftedValue(defn.LiftableModule_ShortIsLiftable)
156-
case Constants.IntTag => liftedValue(defn.LiftableModule_IntIsLiftable)
157-
case Constants.LongTag => liftedValue(defn.LiftableModule_LongIsLiftable)
158-
case Constants.FloatTag => liftedValue(defn.LiftableModule_FloatIsLiftable)
159-
case Constants.DoubleTag => liftedValue(defn.LiftableModule_DoubleIsLiftable)
160-
case Constants.CharTag => liftedValue(defn.LiftableModule_CharIsLiftable)
161-
case Constants.StringTag => liftedValue(defn.LiftableModule_StringIsLiftable)
153+
case Constants.BooleanTag => liftedValue(defn.LiftableModule_BooleanLiftable)
154+
case Constants.ByteTag => liftedValue(defn.LiftableModule_ByteLiftable)
155+
case Constants.ShortTag => liftedValue(defn.LiftableModule_ShortLiftable)
156+
case Constants.IntTag => liftedValue(defn.LiftableModule_IntLiftable)
157+
case Constants.LongTag => liftedValue(defn.LiftableModule_LongLiftable)
158+
case Constants.FloatTag => liftedValue(defn.LiftableModule_FloatLiftable)
159+
case Constants.DoubleTag => liftedValue(defn.LiftableModule_DoubleLiftable)
160+
case Constants.CharTag => liftedValue(defn.LiftableModule_CharLiftable)
161+
case Constants.StringTag => liftedValue(defn.LiftableModule_StringLiftable)
162162
}
163163
}
164164

library/src-bootstrapped/scala/quoted/Expr.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object Expr {
5757
* Otherwise returns the `Some` of the value.
5858
*/
5959
def unlift(using qctx: QuoteContext, unlift: Unliftable[T]): Option[T] =
60-
unlift(expr)
60+
unlift.fromExpr(expr)
6161

6262
/** Return the unlifted value of this expression.
6363
*
@@ -68,7 +68,7 @@ object Expr {
6868
def reportError =
6969
val msg = s"Expected a known value. \n\nThe value of: ${expr.show}\ncould not be unlifted using $unlift"
7070
report.throwError(msg, expr)
71-
unlift(expr).getOrElse(reportError)
71+
unlift.fromExpr(expr).getOrElse(reportError)
7272
end extension
7373

7474
/** `e.betaReduce` returns an expression that is functionally equivalent to `e`,

0 commit comments

Comments
 (0)