@@ -18,15 +18,32 @@ class Expr[+T] private[scala] {
18
18
* Returns `None` if the expression does not contain a value or contains side effects.
19
19
* Otherwise returns the `Some` of the value.
20
20
*/
21
+ @ deprecated(" Use Expr.unlift" , " 0.23" )
21
22
final def getValue [U >: T ](using qctx : QuoteContext , unlift : Unliftable [U ]): Option [U ] = unlift(this )
22
23
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.
24
41
*
25
42
* Emits an error error and throws if the expression does not contain a value or contains side effects.
26
43
* Otherwise returns the value.
27
44
*/
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 ))
30
47
31
48
/** Pattern matches `this` against `that`. Effectively performing a deep equality check.
32
49
* It does the equivalent of
0 commit comments