diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 89eb924598c1..50ce14172b2f 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -2769,6 +2769,15 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler def warning(msg: String, pos: Position): Unit = dotc.report.warning(msg, pos) + def info(msg: String): Unit = + dotc.report.echo(msg, Position.ofMacroExpansion) + + def info(msg: String, expr: Expr[Any]): Unit = + dotc.report.echo(msg, asTerm(expr).pos) + + def info(msg: String, pos: Position): Unit = + dotc.report.echo(msg, pos) + end report private def optional[T <: dotc.ast.Trees.Tree[?]](tree: T): Option[tree.type] = diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 7e6114233d06..baeb9cdbaeb2 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -4098,24 +4098,33 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** Report an error message at the given position */ def error(msg: String, pos: Position): Unit - /** Report an error at the position of the macro expansion and throws a StopMacroExpansion */ + /** Report an error at the position of the macro expansion and throw a StopMacroExpansion */ def throwError(msg: String): Nothing /** Report an error at the position of `expr` */ def throwError(msg: String, expr: Expr[Any]): Nothing - /** Report an error message at the given position and throws a StopMacroExpansion */ + /** Report an error message at the given position and throw a StopMacroExpansion */ def throwError(msg: String, pos: Position): Nothing /** Report a warning at the position of the macro expansion */ def warning(msg: String): Unit - /** Report a warning at the on the position of `expr` */ + /** Report a warning at the position of `expr` */ def warning(msg: String, expr: Expr[Any]): Unit - /** Report an warning message at the given position */ + /** Report a warning message at the given position */ def warning(msg: String, pos: Position): Unit + /** Report an info at the position of the macro expansion */ + def info(msg: String): Unit + + /** Report an info message at the position of `expr` */ + def info(msg: String, expr: Expr[Any]): Unit + + /** Report an info message at the given position */ + def info(msg: String, pos: Position): Unit + }