typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

#:type-name alias not provided with struct-out

Open jackfirth opened this issue 8 years ago • 1 comments

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.

jackfirth avatar Mar 15 '16 08:03 jackfirth

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

samth avatar Mar 15 '16 13:03 samth