Handle methods that have opt args but no kws

Closes PR 14726
This commit is contained in:
Asumu Takikawa 2014-09-07 17:18:40 -04:00
parent bc83e9b778
commit ab47d1bb25
2 changed files with 14 additions and 2 deletions

View File

@ -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)

View File

@ -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)]))]))