diff --git a/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-contracts.rkt b/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-contracts.rkt index 9c86bb1c..7dd5ff2b 100644 --- a/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-contracts.rkt +++ b/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-contracts.rkt @@ -18,7 +18,7 @@ (define-tc/app-syntax-class (tc/app-contracts expected) (pattern (ctc-id:id blame e ...) ;; check that this is an application from the contract system - #:when (contract-rename-id-property #'ctc-id) + #:when (contract-neg-party-property #'ctc-id) (check-contract #'ctc-id #'(e ...) expected))) ;; Assume that the contracted thing is of the same type the type diff --git a/typed-racket-test/succeed/gh-issue-38.rkt b/typed-racket-test/succeed/gh-issue-38.rkt new file mode 100644 index 00000000..d31502d3 --- /dev/null +++ b/typed-racket-test/succeed/gh-issue-38.rkt @@ -0,0 +1,24 @@ +#lang racket + +(module untyped racket + (provide + (contract-out + [f (-> number? number? number?)] + [g (case-> (-> number? number? number?))])) + (define (f x y) + (expt x y)) + (define (g x y) + (expt x y))) + +(module type-env typed-racket/base-env/extra-env-lang + (require (submod ".." untyped)) + (type-environment + [f (-> -Number -Number -Number)] + [g (-> -Number -Number -Number)])) + +(module typed typed/racket + (require (submod ".." type-env) + typed/rackunit) + (check-equal? (f 2 4) (g 2 4))) + +(require 'typed)