This commit is contained in:
Isaac Shoebottom 2025-04-10 08:33:48 -03:00
parent 579b9689d3
commit b1cc807d45

View File

@ -130,7 +130,7 @@
(type-case Type (typecheck fn env)
[(arrowT arg-type result-type)
(let ([actual-type (typecheck arg env)])
(if (equal? arg-type actual-type)
(if (subtype? actual-type arg-type) ;; Use subtype? to check compatibility
result-type
(error 'typecheck "argument type")))]
[else (error 'typecheck "not function")])]