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

From: Ray Racine (ray.racine at gmail.com)
Date: Tue Aug 28 12:40:34 EDT 2012

In the provided example, yes I'm seeing the stale zo issue.  In my "real"
code, each submodule also requires a common module as well and in this
situation I get a cyclic require error as well when check-syntax is
performed as well as the zo error at the bottom of DR.  I don't know if
there are two distinct issues or one domino-ing the other.

On Tue, Aug 28, 2012 at 12:27 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu>wrote:

> On Tue, Aug 28, 2012 at 12:23 PM, Eric Dobson <eric.n.dobson at gmail.com>
> wrote:
> > Possibly, how is it not working for you?
> >
> > With:
> > #lang typed/racket/base
> >
> > (module mytypes racket/base
> >
> >   (provide  S)
> >
> >   (struct S ()))
> >
> > (module tyuser racket/base
> >
> >   (require
> >    (submod ".." mytypes))
> >
> >   (define (mkS value)
> >     (S)))
> >
> > (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
> >   context...:
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:308:0:
> compile-zo*
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:508:26
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:501:42
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:466:0:
> > maybe-compile-zo
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:579:2:
> do-check
> >    /Users/endobson/proj/racket/plt/collects/compiler/cm.rkt:653:4
> >
>  /Users/endobson/proj/racket/plt/collects/compiler/commands/make.rkt:77:8:
> > for-loop
> >    /Users/endobson/proj/racket/plt/collects/compiler/commands/make.rkt:
> > [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.
>
> I believe that this is a bug in Racket, although I'm not sure.  You
> can see a simpler example here:
>
> http://drdr.racket-lang.org/25284/collects/tests/typed-racket/succeed/internal-typed-submod.rkt
>
> >
> > 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
> >>
> > ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
>
>
>
> --
> sam th
> samth at ccs.neu.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120828/1ee8b71c/attachment.html>

Posted on the users mailing list.