Fix error message for misuse of #:methods

Closes PR 14069
This commit is contained in:
Asumu Takikawa 2013-10-08 14:32:34 -04:00
parent f6d62b2813
commit 8df734048c
2 changed files with 10 additions and 2 deletions

View File

@ -43,6 +43,13 @@
#:methods gen:foobar
[(define foo 0)])
'ignore))))
;; Test for PR 14069, make sure that the error reports
;; the faulty syntax as `bar` and not `#:methods`
(check-exn #rx"at: bar"
(lambda () (convert-compile-time-error
(let ()
(struct foo () #:methods bar [])
'ignore))))
(check-exn #rx"foo: not implemented for 5"
(lambda () (let ()
(define-generics foobar

View File

@ -291,9 +291,10 @@
(and (identifier? gen-id)
(syntax-local-value gen-id (lambda () #f))))
(unless (generic-info? gen-val)
(bad "the first argument to the "
(bad "the first argument to the"
(car p)
" is not a name for a generic interface"))
" is not a name for a generic interface"
(cadr p)))
(loop (list* #'#:property
(quasisyntax/loc gen-id
(generic-property #,gen-id))