Fix source location in errors reported by define/match

This commit is contained in:
Alexis King 2017-01-07 08:01:08 -08:00
parent 57e787eec2
commit dc9aa8a569
2 changed files with 8 additions and 2 deletions

View File

@ -55,3 +55,9 @@
(check-equal? (list-fun '(1 2 3)) #t)
(check-equal? (list-fun '(4 5 6)) #f)
(check-exn
#px"^define/match: no matching clause for #f$"
(λ ()
(define/match (f x))
(f #f)))

View File

@ -170,7 +170,7 @@
(define-syntax (define/match stx)
(syntax-parse stx
[(_ ?header:function-header ?clause ...)
(template
(quasitemplate
(define ?header
(match* (?? ?header.params)
(match*/derived (?? ?header.params) #,stx
?clause ...)))])))))