Re: [racket-users] TR: cast on mutable hash table...

2020-02-14 Thread Ben Greenman
On 2/14/20, 'John Clements' via users-redirect wrote: > I think I may understand what’s going on here, but a student and I worked on > this for quite a while today before I found the problem. > > > > In this case, one easy error is to change the ‘cast’ into an ‘ann’, which > works fine. You

Re: [racket-users] TR: cast on mutable hash table...

2020-02-14 Thread Stephen Chang
Your second suggestion is described in this (hard to find) section of the TR Guide on Type Generalization: https://docs.racket-lang.org/ts-guide/caveats.html#%28part._.Type_generalization%29 I agree it should be much more prominent. At the very least, any docs for invariant constructors should

[racket-users] TR: cast on mutable hash table...

2020-02-14 Thread 'John Clements' via users-redirect
I think I may understand what’s going on here, but a student and I worked on this for quite a while today before I found the problem. Here’s a program: #lang typed/racket (define-type Store (Mutable-HashTable Integer Value)) (define-type Value (U Real Boolean String)) (define top-store (cast