@@ -18,15 +18,32 @@ class Expr[+T] private[scala] {
1818 * Returns `None` if the expression does not contain a value or contains side effects.
1919 * Otherwise returns the `Some` of the value.
2020 */
21+ @ deprecated(" Use Expr.unlift" , " 0.23" )
2122 final def getValue [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): Option [U ] = unlift(this )
2223
23- /** Return the value of this expression.
24+ /** Return the unlifted value of this expression.
25+ *
26+ * Returns `None` if the expression does not contain a value or contains side effects.
27+ * Otherwise returns the `Some` of the value.
28+ */
29+ final def unlift [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): Option [U ] =
30+ unlift(this )
31+
32+ /** Return the unlifted value of this expression.
33+ *
34+ * Emits an error error and throws if the expression does not contain a value or contains side effects.
35+ * Otherwise returns the value.
36+ */
37+ @ deprecated(" Use Expr.unlifted" , " 0.23" )
38+ final def value [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): U = unlifted
39+
40+ /** Return the unlifted value of this expression.
2441 *
2542 * Emits an error error and throws if the expression does not contain a value or contains side effects.
2643 * Otherwise returns the value.
2744 */
28- final def value [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): U =
29- unlift(this ).getOrElse(qctx.throwError(s " Expected a known value. \n\n The value of: $show\n could not be recovered using $unlift" , this ))
45+ final def unlifted [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): U =
46+ unlift(this ).getOrElse(qctx.throwError(s " Expected a known value. \n\n The value of: $show\n could not be unlifted using $unlift" , this ))
3047
3148 /** Pattern matches `this` against `that`. Effectively performing a deep equality check.
3249 * It does the equivalent of
0 commit comments