[go: nahoru, domu]

Skip to content

Commit

Permalink
apply: support intersection of function types
Browse files Browse the repository at this point in the history
  • Loading branch information
capfredf committed Mar 19, 2022
1 parent 4e1db2f commit 90cb737
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion typed-racket-lib/typed-racket/typecheck/tc-apply.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"../types/substitute.rkt"
"../types/type-table.rkt"
"../utils/tc-utils.rkt"
"tc-funapp.rkt"
"../rep/type-rep.rkt"
"../rep/core-rep.rkt"
"../rep/values-rep.rkt"
Expand Down Expand Up @@ -81,7 +82,12 @@
(list (-Tuple* arg-tys full-tail-ty))
(list (-Tuple* domain (Rest->Type rst)))
rng))]))
(failure))]
(failure))]
[(tc-result1: (and (? Intersection? f-ty^)))
(tc/funapp f args f-ty^ (append arg-tres
(match full-tail-ty
[(List: ty) (list (ret ty))]))
#f)]
[(tc-result1: (AnyPoly: _ _ (Fun: '())))
(tc-error/expr "Function has no cases")]
[(tc-result1: f-ty)
Expand Down

0 comments on commit 90cb737

Please sign in to comment.