@@ -49,7 +49,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
4949 def unliftOrError (using Unliftable [T ]): T =
5050 def reportError =
5151 val msg = s " Expected a known value. \n\n The value of: ${self.show}\n could not be unlifted using $unlift"
52- report.throwError(msg, self)( using Quotes . this )
52+ reflect. report.throwError(msg, self)
5353 summon[Unliftable [T ]].fromExpr(self)(using Quotes .this ).getOrElse(reportError)
5454
5555 end extension
@@ -3381,24 +3381,47 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
33813381 // REPORTING //
33823382 // /////////////
33833383
3384- val Reporting : ReportingModule
3384+ val report : ReportModule
33853385
3386- /** Module containg error and waring reporiting.
3387- *
3388- * Also see scala.quoted.report
3389- */
3390- trait ReportingModule { self : Reporting .type =>
3391- /** Emits an error message */
3392- def error (msg : => String , pos : Position ): Unit
3386+ /** Module containg error and waring reporiting. */
3387+ trait ReportModule { self : report.type =>
3388+
3389+ /** Report an error at the position of the macro expansion */
3390+ def error (msg : String ): Unit
3391+
3392+ /** Report an error at the position of `expr` */
3393+ def error (msg : String , expr : Expr [Any ]): Unit
3394+
3395+ /** Report an error message at the given position */
3396+ def error (msg : String , pos : Position ): Unit
3397+
3398+ /** Report an error at a specific range of a file. The positions must be contained in the file. */
3399+ def error (msg : String , source : SourceFile , start : Int , end : Int ): Unit
3400+
3401+ /** Report an error at the position of the macro expansion and throws a StopMacroExpansion */
3402+ def throwError (msg : String ): Nothing
3403+
3404+ /** Report an error at the position of `expr` */
3405+ def throwError (msg : String , expr : Expr [Any ]): Nothing
3406+
3407+ /** Report an error message at the given position and throws a StopMacroExpansion */
3408+ def throwError (msg : String , pos : Position ): Nothing
3409+
3410+ /** Report an error at a specific range of a file and throws a StopMacroExpansion. The positions must be contained in the file. */
3411+ def throwError (msg : String , source : SourceFile , start : Int , end : Int ): Nothing
3412+
3413+ /** Report a warning at the position of the macro expansion */
3414+ def warning (msg : String ): Unit
3415+
3416+ /** Report a warning at the on the position of `expr` */
3417+ def warning (msg : String , expr : Expr [Any ]): Unit
33933418
3394- /** Emits an error at a specific range of a file */
3395- def error (msg : => String , source : SourceFile , start : Int , end : Int ): Unit
3419+ /** Report an warning message at the given position */
3420+ def warning (msg : String , pos : Position ): Unit
33963421
3397- /** Emits an error message */
3398- def warning (msg : => String , pos : Position ): Unit
3422+ /** Emits a warning at a specific range of a file. The positions must be contained in the file. */
3423+ def warning (msg : String , source : SourceFile , start : Int , end : Int ): Unit
33993424
3400- /** Emits a warning at a specific range of a file */
3401- def warning (msg : => String , source : SourceFile , start : Int , end : Int ): Unit
34023425 }
34033426
34043427
0 commit comments