typed-racket
typed-racket copied to clipboard
#:type-name alias not provided with struct-out
Racket version: 6.4
When using struct-out
on a struct with a #:type-name
alias, the type alias isn't provided. Example program:
ex.rkt
#lang typed/racket/base
(provide (struct-out foo))
(struct foo ([value : Boolean]) #:type-name Foo)
ex-use.rkt
#lang typed/racket/base
(require "ex.rkt")
(: my-foo Foo)
(define my-foo (foo #t))
This raises Type Checker: parse error in type; type name Foo is unbound in: Foo
. Ideally struct-out
should export the alias.
This will take some doing to make work, since struct-out doesn't know anything about the type name. Here's a plan:
- make our own version of struct info that has the type name, using a substructure
- make our own version of struct-out that understands that
- have struct in TR produce our new struct info