Hi everyone!

I was taking a look at the brag library (http://docs.racket-lang.org/brag/) for 
AST generation and thought of using it in one of my projects which is in TR. I 
started by requiring brag/support with type annotations like this:

#lang typed/racket

(require/typed brag/support
               [#:opaque Token token-struct?]
               [token (->* ((U String Symbol))
                           (Any
                            #:line Positive-Integer
                            #:column Natural
                            #:position Positive-Integer
                            #:span Natural
                            #:skip? Boolean)
                           Token)])

This worked. So far so good. But when trying to import a file which has #lang 
brag in it I encountered this problem.

(require/typed "grammar1.rkt"
              [parse (->* (Listof Token)
                          (Any)
                          Syntax)])

Type Checker: Type (->* (Listof Token) (Any) Syntax) could not be converted to 
a contract: required a flat contract but generated a chaperone contract in: 
(->* (Listof Token) (Any) Syntax)

I am not sure what this means exactly but is this because Racket does not see 
the automatically exported function parse (or parse-tree) from a #lang brag 
module? And, is there a way to correct this error so that I can call the parse 
function from a TR module? 

Note: I found a github issue that could be related to this here: 
https://github.com/racket/typed-racket/issues/338

Thanks, 
Sourav

-- 
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 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to