diff --git a/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt b/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt index 113ee1da..4f655a94 100644 --- a/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt +++ b/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt @@ -153,6 +153,8 @@ [_ (tc-error/expr "Wrong number of arguments to parameter - expected 0 or 1, got ~a" (length argtys))])] + [(Distinction: _ _ t) + (tc/funapp f-stx args-stx t args-res expected)] ;; resolve names, polymorphic apps, mu, etc [(? needs-resolving?) (tc/funapp f-stx args-stx (resolve-once f-type) args-res expected)] diff --git a/typed-racket-test/succeed/define-new-subtype-function.rkt b/typed-racket-test/succeed/define-new-subtype-function.rkt new file mode 100644 index 00000000..2a75e168 --- /dev/null +++ b/typed-racket-test/succeed/define-new-subtype-function.rkt @@ -0,0 +1,8 @@ +#lang typed/racket + +(define-new-subtype F (make-F (-> Real Real))) + +(: app : F Real -> Real) +(define (app f x) + (f x)) +