Make infer unfold Mu before spliting on Unions.
This commit is contained in:
parent
d4eaa47b27
commit
8014db0f7d
|
@ -521,6 +521,10 @@
|
|||
;; constrain b1 to be below T, but don't mention the new vars
|
||||
[((Poly: v1 b1) T) (cgen (context-add context #:bounds v1) b1 T)]
|
||||
|
||||
;; Mu's just get unfolded
|
||||
[((? Mu? s) t) (cg (unfold s) t)]
|
||||
[(s (? Mu? t)) (cg s (unfold t))]
|
||||
|
||||
;; constrain *each* element of es to be below T, and then combine the constraints
|
||||
[((Union: es) T)
|
||||
(define cs (for/list/fail ([e (in-list es)]) (cg e T)))
|
||||
|
@ -622,10 +626,6 @@
|
|||
[((Set: t) (Sequence: (list t*)))
|
||||
(cg t t*)]
|
||||
|
||||
;; Mu's just get unfolded
|
||||
;; We unfold S first so that unions are handled in S before T
|
||||
[((? Mu? s) t) (cg (unfold s) t)]
|
||||
[(s (? Mu? t)) (cg s (unfold t))]
|
||||
|
||||
;; resolve applications
|
||||
[((App: _ _ _) _)
|
||||
|
|
|
@ -257,6 +257,11 @@
|
|||
#:vars '(a)
|
||||
#:result [(-seq (-v a)) (-seq (-val 'b))]]
|
||||
|
||||
[infer-t
|
||||
(-lst (-val (-v a)))
|
||||
(Un (-pair (-v a) Univ) -Null)
|
||||
#:vars '(a)]
|
||||
|
||||
;; Currently Broken
|
||||
;(infer-t (make-ListDots -Symbol 'b) (-pair -Symbol (-lst -Symbol)) #:indices '(b))
|
||||
[i2-t (-v a) N ('a N)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user