[racket] TR - Require of a struct: defined in a submodule in a submodule.

From: Eric Dobson (eric.n.dobson at gmail.com)
Date: Tue Aug 28 12:23:00 EDT 2012

Possibly, how is it not working for you?

#lang typed/racket/base

(module mytypes racket/base

  (provide  S)

  (struct S ()))

(module tyuser racket/base

   (submod ".." mytypes))

  (define (mkS value)

(note submodules are now in plain racket)

I get:
tmp.rkt:17:5: link: module mismatch;
 possibly, bytecode file needs re-compile because dependencies changed
  importing module: 'tyuser
  exporting module: 'tmp
  exporting phase level: 0
  internal explanation: variable not provided (directly or indirectly)
  at: make-S
  in: make-S.1
   /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:308:0: compile-zo*
   /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:579:2: do-check
[running body]
   /Users/endobson/proj/racket/plt/collects/raco/raco.rkt: [running body]
   /Users/endobson/proj/racket/plt/collects/raco/main.rkt: [running body]

Which looks like a bug in TR handling of submodules.

On Tue, Aug 28, 2012 at 7:32 AM, Ray Racine <ray.racine at gmail.com> wrote:
> The following does not work.  Bug?
> #lang typed/racket/base
> (module mytypes typed/racket/base
>   (provide
>    (struct-out S))
>   (struct: S ()))
> (module tyuser typed/racket/base
>   (require
>    (submod ".." mytypes))
>   (: mkS (Any -> S))
>   (define (mkS value)
>     (S)))
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.