It looks to me like TR can’t generate contracts for prefab structs in a way
that I would expect it to. Specifically, here’s a TR file and a Racket file
that uses a TR-defined prefab structure:
(provide (struct-out Foo)
(struct Foo ([a : String]) #:prefab)
(define a (get-a-foo))
This doesn’t typecheck (at least not in version 220.127.116.11--2017-11-05, tell me
if I should just upgrade), with the message:
Type Checker: could not convert type to a contract;
contract generation not supported for this type
type: (-> Foo) in: (get-a-foo)
My first thought was that this was related to mutability, but the docs and my
experiments suggest that prefab structures are default-immutable, and that this
is reflected in a way that should be visible to the type-checker. Am I missing
something, or is this just something that we haven’t yet had time to implement?
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.