Skip to content

Help scala.quoted migration from 3.0.0-M2 to 3.0.0-M3 #10680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions library/src-bootstrapped/scala/quoted/Unlifted.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package scala.quoted

@deprecated("Use `scala.quoted.Expr` instead. This will be removed in 3.0.0-RC1", "3.0.0-M3")
object Unlifted:

@deprecated("Use `scala.quoted.Expr.unapply` instead. This will be removed in 3.0.0-RC1", "3.0.0-M3")
def apply[T](expr: Expr[T])(using FromExpr[T])(using Quotes): Option[T] =
Expr.unapply(expr)

@deprecated("Use `scala.quoted.Exprs.unapply` instead. This will be removed in 3.0.0-RC1", "3.0.0-M3")
def unapply[T](exprs: Seq[Expr[T]])(using FromExpr[T])(using Quotes): Option[Seq[T]] =
Exprs.unapply(exprs)

end Unlifted
6 changes: 6 additions & 0 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
*/
def matches(that: Expr[Any]): Boolean

@deprecated("Use `.value` instead. This will be removed in 3.0.0-RC1", "3.0.0-M3")
def unlift(using FromExpr[T]): Option[T] = self.value

@deprecated("Use `.unliftOrError` instead. This will be removed in 3.0.0-RC1", "3.0.0-M3")
def unliftOrError(using FromExpr[T]): T = self.valueOrError

/** Return the value of this expression.
*
* Returns `None` if the expression does not represent a value or possibly contains side effects.
Expand Down