Support rest args for TR class methods
original commit: 4439c9df0d5a367399bb92107954c9b47338c8af
This commit is contained in:
parent
f46e98bce9
commit
b80597a56d
|
@ -1361,7 +1361,7 @@
|
|||
(syntax-parse stx
|
||||
#:literals (let-values #%plain-lambda case-lambda)
|
||||
[(let-values ([(meth-name:id)
|
||||
(#%plain-lambda (self-param:id id:id ...)
|
||||
(#%plain-lambda (self-param:id . params)
|
||||
body ...)])
|
||||
m)
|
||||
(define annotated-self-param
|
||||
|
@ -1370,12 +1370,12 @@
|
|||
;; attach source location to the lambda in order to
|
||||
;; obtain better error messages for arity errors
|
||||
#,(quasisyntax/loc stx
|
||||
(#%plain-lambda (#,annotated-self-param id ...)
|
||||
(#%plain-lambda (#,annotated-self-param . params)
|
||||
body ...))])
|
||||
m)]
|
||||
[(let-values ([(meth-name:id)
|
||||
(let-values (((core:id)
|
||||
(#%plain-lambda (param:id ...)
|
||||
(#%plain-lambda params
|
||||
core-body ...)))
|
||||
method-body ...)])
|
||||
m)
|
||||
|
@ -1384,7 +1384,7 @@
|
|||
#`(let-values (((core)
|
||||
;; see comment above
|
||||
#,(quasisyntax/loc stx
|
||||
(#%plain-lambda (param ...)
|
||||
(#%plain-lambda params
|
||||
core-body ...))))
|
||||
method-body ...)
|
||||
#t)])
|
||||
|
|
|
@ -1271,4 +1271,11 @@
|
|||
(public m)
|
||||
(define m (case-lambda [(x) "bad"])))
|
||||
#:msg #rx"expected: Integer.*given: String"]
|
||||
;; test that rest args work
|
||||
[tc-e (let ()
|
||||
(class object% (super-new)
|
||||
(: m (-> Integer * Integer))
|
||||
(define/public (m . xs) (apply + xs)))
|
||||
(void))
|
||||
-Void]
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue
Block a user