@@ -49,7 +49,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
49
49
def unliftOrError (using Unliftable [T ]): T =
50
50
def reportError =
51
51
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)
53
53
summon[Unliftable [T ]].fromExpr(self)(using Quotes .this ).getOrElse(reportError)
54
54
55
55
end extension
@@ -3381,24 +3381,47 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3381
3381
// REPORTING //
3382
3382
// /////////////
3383
3383
3384
- val Reporting : ReportingModule
3384
+ val report : ReportModule
3385
3385
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
3393
3418
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
3396
3421
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
3399
3424
3400
- /** Emits a warning at a specific range of a file */
3401
- def warning (msg : => String , source : SourceFile , start : Int , end : Int ): Unit
3402
3425
}
3403
3426
3404
3427
0 commit comments