diff --git a/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt b/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt index 48b87772..c4f5d770 100644 --- a/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt +++ b/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt @@ -153,8 +153,8 @@ (let-values ([(field-name:id) accessor-or-mutator] ...) :make-methods-body)))) -(define-syntax-class class-expansion - #:literals (#%plain-app quote) +(define-syntax-class core-class-expansion + #:literals (let-values letrec-syntaxes+values #%plain-app quote) #:attributes (superclass-expr make-methods initializer-body @@ -170,6 +170,16 @@ (quote :boolean) (quote #f)))) +(define-syntax-class class-expansion + #:literals (#%expression) + #:attributes (superclass-expr + make-methods + initializer-body + initializer-self-id + initializer-args-id) + (pattern :core-class-expansion) + (pattern (#%expression :core-class-expansion))) + ;; This is similar to `type-declaration` from "internal-forms.rkt", but ;; the expansion is slightly different in a class so we use this instead. (define-syntax-class class-type-declaration diff --git a/typed-racket-test/unit-tests/typecheck-tests.rkt b/typed-racket-test/unit-tests/typecheck-tests.rkt index c080ac22..2ce9a3a8 100644 --- a/typed-racket-test/unit-tests/typecheck-tests.rkt +++ b/typed-racket-test/unit-tests/typecheck-tests.rkt @@ -51,7 +51,7 @@ ;; tr-expand: syntax? -> syntax? ;; Expands out a form and annotates it with necesarry TR machinery. (define (tr-expand stx) - (define expanded-stx (local-expand stx 'expression '())) + (define expanded-stx (syntax-local-introduce (local-expand stx 'expression '()))) (find-mutated-vars expanded-stx mvar-env) expanded-stx)