allow values with define-new-subtype types as functions
This commit is contained in:
parent
efb877dbfb
commit
0037a0277f
|
@ -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)]
|
||||
|
|
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user