diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/class-prims.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/class-prims.rkt index e63e45b6..fcae3455 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/class-prims.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/class-prims.rkt @@ -274,7 +274,6 @@ ;; this is mostly cribbed from class-internal.rkt (define (expand-expressions stxs ctx def-ctx) (define (class-expand stx) - ;; try using syntax-local-expand-expression? (local-expand stx ctx stop-forms def-ctx)) (let loop ([stxs stxs]) (cond [(null? stxs) null] @@ -288,12 +287,9 @@ ;; i.e., macro definitions in the class body ;; see class-internal.rkt as well [(define-syntaxes (name:id ...) rhs:expr) - (define/with-syntax expanded-rhs - (local-transformer-expand #'rhs 'expression null)) (syntax-local-bind-syntaxes - (syntax->list #'(name ...)) #'expanded-rhs def-ctx) - (cons #'(define-syntaxes (name ...) expanded-rhs) - (loop (cdr stxs)))] + (syntax->list #'(name ...)) #'rhs def-ctx) + (cons stx (loop (cdr stxs)))] [(define-values (name:id ...) rhs:expr) (syntax-local-bind-syntaxes (syntax->list #'(name ...)) #f def-ctx) 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 2487d4f4..cf9c2c39 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 @@ -1413,4 +1413,14 @@ (init x))) #:ret (ret (-poly (A) (-class #:init ([x A #f])))) #:expected (ret (-poly (A) (-class #:init ([x A #f]))) -no-filter -no-obj)] - )) + ;; test uses of a macro in the body of the class + [tc-e + (let () + (define c% + (class object% + (super-new) + (define-syntax-rule (my-meth (m arg ...) . body) + (define/public (m arg ...) . body)) + (my-meth (hello) (displayln "hello world")))) + (send (new c%) hello)) + -Void]))