diff --git a/pkgs/racket-test-core/tests/racket/srcloc.rktl b/pkgs/racket-test-core/tests/racket/srcloc.rktl index a79f6618df..d4289e4673 100644 --- a/pkgs/racket-test-core/tests/racket/srcloc.rktl +++ b/pkgs/racket-test-core/tests/racket/srcloc.rktl @@ -336,6 +336,11 @@ (test #t regexp-match? #rx"listof srcloc[?]" (go (a "msg" (current-continuation-marks) 'oops) #:catch? #t)) + (parameterize ([error-print-context-length 0]) + (test #f regexp-match? #rx"here" (go (a "msg" (current-continuation-marks) + (list (srcloc "here" 1 2 3 4) + (srcloc "there" 10 20 30 40)))))) + (void)) (report-errs) diff --git a/racket/src/cs/rumble/error.ss b/racket/src/cs/rumble/error.ss index 5a952bf1e7..8879691b06 100644 --- a/racket/src/cs/rumble/error.ss +++ b/racket/src/cs/rumble/error.ss @@ -701,9 +701,10 @@ (and (exn? v) (not (exn:fail:user? v)))) (let* ([n (|#%app| error-print-context-length)] - [locs (if (exn:srclocs? v) + [locs (if (and (exn:srclocs? v) + (not (zero? n))) ((exn:srclocs-accessor* v) v) - null)] + '())] [l (if (zero? n) '() (traces->context