improve send error message in the case that there is only one arg

closes PR 12091
This commit is contained in:
Robby Findler 2011-08-06 19:20:21 -05:00
parent 2d4e14dca8
commit 1218cbfef6
2 changed files with 7 additions and 1 deletions

View File

@ -3822,7 +3822,10 @@
(flatten-args #'args) #t)))]
[(form obj name . args)
(raise-syntax-error
#f "method name is not an identifier" stx #'name)])))
#f "method name is not an identifier" stx #'name)]
[(form obj)
(raise-syntax-error
#f "expected a method name" stx)])))
(values
;; send

View File

@ -14,6 +14,9 @@
(test #t class? (class object%))
(syntax-test #'(class object% . 10))
(error-test #'(send 7) (lambda (x) (and (exn:fail:syntax? x) (regexp-match "method" (exn-message x)))))
(error-test #'(send/apply 7) (lambda (x) (and (exn:fail:syntax? x) (regexp-match "method" (exn-message x)))))
(define (test-init/field init)
(teval #`(test #t class? (class object% (#,init))))
(syntax-test #`(class object% (#,init . x)))