improve send error message in the case that there is only one arg
closes PR 12091
This commit is contained in:
parent
2d4e14dca8
commit
1218cbfef6
|
@ -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
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user