Fix opt-lambda property on opt-lambda methods

Related to PR 14726

original commit: 3905334f28a9ffdf2d963c21f159fc1ccf642632
This commit is contained in:
Asumu Takikawa 2014-09-08 16:30:27 -04:00
parent ccfda8d066
commit 34eeeb62bc
2 changed files with 21 additions and 1 deletions

View File

@ -1448,6 +1448,16 @@
(syntax/loc stx core)
(attribute kw.value))])
m))]
[(~and (let-values ([(meth-name:id) core]) m)
opt:opt-lambda^)
(match-define (list required optional) (attribute opt.value))
(quasisyntax/loc stx
(let-values ([(meth-name)
#,(opt-lambda-property
(syntax/loc stx core)
(list (add1 required) ; for `this` argument
optional))])
m))]
[_ stx]))
;; Set<Symbol> Set<Symbol> String -> Void

View File

@ -1505,4 +1505,14 @@
(super-new)
(define/public (foo [i #f]) (void))))
(new a%))
(-object #:method ([foo (t:-> -Integer -Void)]))]))
(-object #:method ([foo (t:-> -Integer -Void)]))]
[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 (cl->* (t:-> -Void) (t:-> -Integer -Void))]))]))