Fix tc-let for mutable variables.

Closes PR 14415.

original commit: b09ced6a0cc085bb0ed38b0bdb210a531a7e645f
This commit is contained in:
Eric Dobson 2014-03-24 22:20:21 -07:00
parent 8005c6be2f
commit e1851074b7
2 changed files with 13 additions and 3 deletions

View File

@ -4,7 +4,7 @@
(except-in (types utils abbrev union filter-ops) -> ->* one-of/c)
(only-in (types abbrev) (-> t:->))
(private type-annotation parse-type syntax-properties)
(env lexical-env type-alias-env type-alias-helper
(env lexical-env type-alias-env type-alias-helper mvar-env
global-env type-env-structs scoped-tvar-env)
(rep type-rep filter-rep)
syntax/free-vars
@ -45,8 +45,10 @@
(for/list ([n (in-list names)]
[f+ (in-list fs+)]
[f- (in-list fs-)])
(list (-imp (-not-filter (-val #f) n) f+)
(-imp (-filter (-val #f) n) f-)))))]
(if (is-var-mutated? n)
(list)
(list (-imp (-not-filter (-val #f) n) f+)
(-imp (-filter (-val #f) n) f-))))))]
[((tc-results: ts (NoFilter:) _) (tc-results: e-ts (NoFilter:) _))
(values ts e-ts null)]))))
(with-cond-contract append-region ([p1 (listof Filter?)]

View File

@ -2642,6 +2642,14 @@
#:ret (ret (-val 3) -top-filter)
#:expected (ret (-val 3) -no-filter -no-obj)]
[tc-err
(let* ([x 42]
[n x])
(set! n 43)
(if #t
(add1 "")
0))
#:ret (ret -Bottom)]
)
(test-suite