allow values with define-new-subtype types as functions

This commit is contained in:
AlexKnauth 2015-08-15 19:00:35 -05:00
parent efb877dbfb
commit 0037a0277f
2 changed files with 10 additions and 0 deletions

View File

@ -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)]

View File

@ -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))