This commit is contained in:
Isaac Shoebottom 2025-04-10 08:54:01 -03:00
parent 14b79a7d2a
commit 81c8032091

View File

@ -20,8 +20,7 @@
[let1E (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
[recE (var : Symbol) (te : TypeExp) (value : Exp) (body : Exp)]
[objE (fields : (Listof (Symbol * Exp)))]
[msgE (obj : Exp) (selector : Symbol)]
)
[msgE (obj : Exp) (selector : Symbol)])
(define-type Type
[numT]
@ -84,11 +83,11 @@
#t
(let ([key (first keys)])
(let ([Y-type (some-v (hash-ref Y-fields key))])
(type-case (Optionof Type) (hash-ref X-fields key)
[(none) #f] ;; Key not found in X-fields
[(some X-type)
(and (subtype? X-type Y-type) ;; Check subtyping of field types
(loop (rest keys)))])))))] ;; Recurse on remaining keys
(type-case (Optionof Type) (hash-ref X-fields key)
[(none) #f] ;; Key not found in X-fields
[(some X-type)
(and (subtype? X-type Y-type) ;; Check subtyping of field types
(loop (rest keys)))])))))] ;; Recurse on remaining keys
(loop (hash-keys Y-fields)))]
[else #f])]))