diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/with-types.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/with-types.rkt index 9b94bec665..73a3c8beb9 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/with-types.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/with-types.rkt @@ -117,6 +117,8 @@ #'(void) 'disappeared-binding (disappeared-bindings-todo)) 'disappeared-use (disappeared-use-todo))]) + (define fixed-up-definitions + (change-contract-fixups lifted-definitions)) (arm (if expr? (quasisyntax/loc stx @@ -124,14 +126,14 @@ (c:with-contract typed-region #:results (region-cnt ...) #:freevars ([fv.id cnt] ...) - #,lifted-definitions + #,fixed-up-definitions body))) (quasisyntax/loc stx (begin (define-values () (begin check-syntax-help (values))) (c:with-contract typed-region ([ex-id ex-cnt] ...) - #,lifted-definitions + #,fixed-up-definitions (define-values (ex-id ...) body)))))))) ;; Syntax (U Symbol List) -> (values Syntax Syntax) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/with-type-lift.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/with-type-lift.rkt index 8f2d2c3a9e..ebfcb45465 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/with-type-lift.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/with-type-lift.rkt @@ -16,3 +16,10 @@ (with-type ([val Number]) (define val (m2))) (check-equal? val 3) + +(with-type #:result (Listof String) + ;; casts do lifts for the contract + (define x (cast '() (Listof String))) + ;; as do predicates + (make-predicate (Listof String)) + x)