Two fixes in overlap checking.
- Names were not being resolved, so a superstruct name and substruct name could be seen as non-overlapping. - Struct parents were not checked in the overlapping algorithm.
This commit is contained in:
parent
8d6230956d
commit
654b7df1de
|
@ -23,7 +23,8 @@
|
||||||
[(list _ (Univ:)) #t]
|
[(list _ (Univ:)) #t]
|
||||||
[(list (F: _) _) #t]
|
[(list (F: _) _) #t]
|
||||||
[(list _ (F: _)) #t]
|
[(list _ (F: _)) #t]
|
||||||
[(list (Name: n) (Name: n*)) (free-identifier=? n n*)]
|
[(list (Name: n) (Name: n*))
|
||||||
|
(overlap (resolve-once t1) (resolve-once t2))]
|
||||||
[(list (? Mu?) _) (overlap (unfold t1) t2)]
|
[(list (? Mu?) _) (overlap (unfold t1) t2)]
|
||||||
[(list _ (? Mu?)) (overlap t1 (unfold t2))]
|
[(list _ (? Mu?)) (overlap t1 (unfold t2))]
|
||||||
[(list (Union: e) t)
|
[(list (Union: e) t)
|
||||||
|
@ -68,12 +69,16 @@
|
||||||
[(list (Struct: n #f flds _ _ _ _ _)
|
[(list (Struct: n #f flds _ _ _ _ _)
|
||||||
(StructTop: (Struct: n* #f flds* _ _ _ _ _)))
|
(StructTop: (Struct: n* #f flds* _ _ _ _ _)))
|
||||||
#f]
|
#f]
|
||||||
[(list (Struct: n p flds _ _ _ _ _)
|
[(list (and t1 (Struct: n p flds _ _ _ _ _))
|
||||||
(Struct: n* p* flds* _ _ _ _ _))
|
(and t2 (Struct: n* p* flds* _ _ _ _ _)))
|
||||||
|
(let ([p1 (if (Name? p) (resolve-name p) p)]
|
||||||
|
[p2 (if (Name? p*) (resolve-name p*) p*)])
|
||||||
|
(or (overlap t1 p2)
|
||||||
|
(overlap t2 p1)
|
||||||
(and (= (length flds) (length flds*))
|
(and (= (length flds) (length flds*))
|
||||||
(for/and ([f flds] [f* flds*])
|
(for/and ([f flds] [f* flds*])
|
||||||
(match* (f f*)
|
(match* (f f*)
|
||||||
[((fld: t _ _) (fld: t* _ _)) (overlap t t*)])))]
|
[((fld: t _ _) (fld: t* _ _)) (overlap t t*)])))))]
|
||||||
[(list (== (-val eof))
|
[(list (== (-val eof))
|
||||||
(Function: _))
|
(Function: _))
|
||||||
#f]
|
#f]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user