diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt index c6480f82..aaf2b70e 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt @@ -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 Set String -> Void diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt index 3cdceaff..ee6abd19 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt @@ -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))]))]))