diff options
author | JJ | 2024-06-15 03:51:32 +0000 |
---|---|---|
committer | JJ | 2024-06-15 03:51:32 +0000 |
commit | cdaf46285227528e336418144ed9faae58e5422a (patch) | |
tree | 7de5890975b9275a6d10a27eac79e07e6d8d0af9 /stlc-ref.rkt | |
parent | 0947a5ba0ffa38397b4d5e760c5e0ed4c8288e6d (diff) |
stlc-*: do not throw errors within check
Diffstat (limited to 'stlc-ref.rkt')
-rw-r--r-- | stlc-ref.rkt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stlc-ref.rkt b/stlc-ref.rkt index 6194728..73365f2 100644 --- a/stlc-ref.rkt +++ b/stlc-ref.rkt @@ -54,7 +54,7 @@ [(`(set ,e1 ,e2) 'Unit) (match (infer- e1 Γ) [`(Ref ,t) (check- e2 t Γ)] - [t (err (format "attempting to update non-reference ~a: ~a" e1 t))])] + [t #f])] [(`(λ ,x (: ,t) ,e) `(→ ,t1 ,t2)) (and (equal? t t1) (check- e t2 (dict-set Γ x t1)))] @@ -62,9 +62,9 @@ (match (infer- e1 Γ) [`(→ ,t1 ,t2) (and (equal? t2 t) (equal? t1 (infer- e2 Γ)))] - [t (err (format "expected → type on application body, got ~a" t))])] + [t #f])] - [(e t) (err (format "checking an unknown expression ~a with type ~a" e t))])) + [(e t) #f])) ;; (infer Expr Table[Sym, Type]): Type (define (infer expr [Γ #hash()]) |