Handle methods that have opt args but no kws
Closes PR 14726
This commit is contained in:
parent
bc83e9b778
commit
ab47d1bb25
|
@ -1421,7 +1421,7 @@
|
|||
core-body ...)))
|
||||
method-body ...)])
|
||||
m)
|
||||
kw:kw-lambda^)
|
||||
(~or kw:kw-lambda^ opt:opt-lambda^))
|
||||
(do-register #'self-param #'meth-name)]
|
||||
;; case-lambda methods
|
||||
[(let-values ([(meth-name:id)
|
||||
|
|
|
@ -1493,4 +1493,16 @@
|
|||
[tc-err (make-object (ann object% ClassTop))
|
||||
#:msg #rx"cannot instantiate.*ClassTop"]
|
||||
[tc-err (make-object 3)
|
||||
#:msg #rx"value of a non-class type"]))
|
||||
#:msg #rx"value of a non-class type"]
|
||||
;; PR 14726
|
||||
;; test opt-arg but non-keyword method
|
||||
[tc-e (let ()
|
||||
(define-type-alias A%
|
||||
(Class [foo (->* [Integer] Void)]))
|
||||
(: a% A%)
|
||||
(define a%
|
||||
(class object%
|
||||
(super-new)
|
||||
(define/public (foo [i #f]) (void))))
|
||||
(new a%))
|
||||
(-object #:method ([foo (t:-> -Integer -Void)]))]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user