Skip to content

Commit

Permalink
Merge pull request #13312 from dotty-staging/stabilize-reflect-abort-api
Browse files Browse the repository at this point in the history
Stabilize Quotes `abort` API
  • Loading branch information
anatoliykmetyuk authored Aug 24, 2021
2 parents 11b98c2 + 234dbbf commit 79f3114
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* Emits an error and throws if the expression does not represent a value or possibly contains side effects.
* Otherwise returns the value.
*/
// TODO: deprecate in 3.1.0 and remove @experimental from valueOrAbort
// @deprecated("Use valueOrThrow", "3.1.0")
@deprecated("Use valueOrAbort", "3.1.0")
def valueOrError(using FromExpr[T]): T =
val fromExpr = summon[FromExpr[T]]
def reportError =
Expand All @@ -69,7 +68,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* Emits an error and aborts if the expression does not represent a value or possibly contains side effects.
* Otherwise returns the value.
*/
@experimental
def valueOrAbort(using FromExpr[T]): T

end extension
Expand Down Expand Up @@ -4192,30 +4190,24 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
def error(msg: String, pos: Position): Unit

/** Report an error at the position of the macro expansion and throw a StopMacroExpansion */
@experimental
def errorAndAbort(msg: String): Nothing

/** Report an error at the position of `expr` and throw a StopMacroExpansion */
@experimental
def errorAndAbort(msg: String, expr: Expr[Any]): Nothing

/** Report an error message at the given position and throw a StopMacroExpansion */
@experimental
def errorAndAbort(msg: String, pos: Position): Nothing

/** Report an error at the position of the macro expansion and throw a StopMacroExpansion */
// TODO: deprecate in 3.1.0 and remove @experimental from errorAndAbort
// @deprecated("Use errorAndAbort", "3.1.0")
@deprecated("Use errorAndAbort", "3.1.0")
def throwError(msg: String): Nothing

/** Report an error at the position of `expr` and throw a StopMacroExpansion */
// TODO: deprecate in 3.1.0 and remove @experimental from errorAndAbort
// @deprecated("Use errorAndAbort", "3.1.0")
@deprecated("Use errorAndAbort", "3.1.0")
def throwError(msg: String, expr: Expr[Any]): Nothing

/** Report an error message at the given position and throw a StopMacroExpansion */
// TODO: deprecate in 3.1.0 and remove @experimental from errorAndAbort
// @deprecated("Use errorAndAbort", "3.1.0")
@deprecated("Use errorAndAbort", "3.1.0")
def throwError(msg: String, pos: Position): Nothing

/** Report a warning at the position of the macro expansion */
Expand Down

0 comments on commit 79f3114

Please sign in to comment.