a couple small fixes

svn: r14643

original commit: ce0032f4c5d1262848d58f48d6846446b3f46f28
This commit is contained in:
Sam Tobin-Hochstadt 2009-04-28 18:53:16 +00:00
parent 3161d6d8a3
commit fa0e28678a
3 changed files with 7 additions and 3 deletions

View File

@ -48,4 +48,8 @@
#{(lambda: ([x : Number]) 1) :: (Integer -> Any)}
#{(lambda: ([x : Number]) x) :: (Number -> Number)}
#{(lambda: ([x : Number]) x) :: (Integer -> Any)}
(define zzz 1)
(set! zzz 2)
(define-struct: xxx ())

View File

@ -298,8 +298,8 @@
(tc/letrec-values #'((name ...) ...) #'(expr ...) #'body form)]
;; mutation!
[(set! id val)
(match-let* ([(tc-result: id-t) (tc-expr #'id)]
[(tc-result: val-t) (tc-expr #'val)])
(match-let* ([(tc-result1: id-t) (tc-expr #'id)]
[(tc-result1: val-t) (tc-expr #'val)])
(unless (subtype val-t id-t)
(tc-error/expr "Mutation only allowed with compatible types:~n~a is not a subtype of ~a" val-t id-t))
(ret -Void))]

View File

@ -114,7 +114,7 @@
(begin0 (tc-expr #'expr)
(restore-errors!))))
=> (match-lambda
[(tc-result: t)
[(tc-result1: t)
(register-type (car vars) t)
(list (make-def-binding (car vars) t))]
[t (int-err "~a is not a tc-result" t)])]