a couple small fixes
svn: r14643 original commit: ce0032f4c5d1262848d58f48d6846446b3f46f28
This commit is contained in:
parent
3161d6d8a3
commit
fa0e28678a
|
@ -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 ())
|
||||
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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)])]
|
||||
|
|
Loading…
Reference in New Issue
Block a user