Skip to content

Commit fd70266

Browse files
committed
Remove deprecated Expr.{value, getValue}
1 parent 5aec4f8 commit fd70266

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ class Expr[+T] private[scala] {
1313
def show(syntaxHighlight: SyntaxHighlight)(using qctx: QuoteContext): String =
1414
this.unseal.showWith(syntaxHighlight)
1515

16-
/** Return the value of this expression.
17-
*
18-
* Returns `None` if the expression does not contain a value or contains side effects.
19-
* Otherwise returns the `Some` of the value.
20-
*/
21-
@deprecated("Use Expr.unlift", "0.23")
22-
final def getValue[U >: T](using qctx: QuoteContext, unlift: Unliftable[U]): Option[U] = unlift(this)
23-
2416
/** Return the unlifted value of this expression.
2517
*
2618
* Returns `None` if the expression does not contain a value or contains side effects.
@@ -29,14 +21,6 @@ class Expr[+T] private[scala] {
2921
final def unlift[U >: T](using qctx: QuoteContext, unlift: Unliftable[U]): Option[U] =
3022
unlift(this)
3123

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.unliftOrError", "0.23")
38-
final def value[U >: T](using qctx: QuoteContext, unlift: Unliftable[U]): U = unliftOrError
39-
4024
/** Return the unlifted value of this expression.
4125
*
4226
* Emits an error and throws if the expression does not contain a value or contains side effects.

tests/run-macros/power-macro/Macro_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44
inline def power(x: Double, inline n: Int) = ${ powerCode1('x, 'n) }
55

66
private def powerCode1(using qctx: QuoteContext)(x: Expr[Double], n: Expr[Int]): Expr[Double] =
7-
powerCode(x, n.value)
7+
powerCode(x, n.unliftOrError)
88

99
private def powerCode(using qctx: QuoteContext)(x: Expr[Double], n: Int): Expr[Double] =
1010
if (n == 0) Expr(1.0)

0 commit comments

Comments
 (0)