Fix tc-let for mutable variables.
Closes PR 14415. original commit: b09ced6a0cc085bb0ed38b0bdb210a531a7e645f
This commit is contained in:
parent
8005c6be2f
commit
e1851074b7
|
@ -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?)]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user