reformat
This commit is contained in:
parent
14b79a7d2a
commit
81c8032091
@ -20,8 +20,7 @@
|
|||||||
[let1E (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
|
[let1E (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
|
||||||
[recE (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
|
[recE (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
|
||||||
[objE (fields : (Listof (Symbol * Exp)))]
|
[objE (fields : (Listof (Symbol * Exp)))]
|
||||||
[msgE (obj : Exp) (selector : Symbol)]
|
[msgE (obj : Exp) (selector : Symbol)])
|
||||||
)
|
|
||||||
|
|
||||||
(define-type Type
|
(define-type Type
|
||||||
[numT]
|
[numT]
|
||||||
@ -84,11 +83,11 @@
|
|||||||
#t
|
#t
|
||||||
(let ([key (first keys)])
|
(let ([key (first keys)])
|
||||||
(let ([Y-type (some-v (hash-ref Y-fields key))])
|
(let ([Y-type (some-v (hash-ref Y-fields key))])
|
||||||
(type-case (Optionof Type) (hash-ref X-fields key)
|
(type-case (Optionof Type) (hash-ref X-fields key)
|
||||||
[(none) #f] ;; Key not found in X-fields
|
[(none) #f] ;; Key not found in X-fields
|
||||||
[(some X-type)
|
[(some X-type)
|
||||||
(and (subtype? X-type Y-type) ;; Check subtyping of field types
|
(and (subtype? X-type Y-type) ;; Check subtyping of field types
|
||||||
(loop (rest keys)))])))))] ;; Recurse on remaining keys
|
(loop (rest keys)))])))))] ;; Recurse on remaining keys
|
||||||
(loop (hash-keys Y-fields)))]
|
(loop (hash-keys Y-fields)))]
|
||||||
[else #f])]))
|
[else #f])]))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user