Hi,

Meanwhile, I reduced the problematic code to a maneageable fragment.

The following code typechecks and runs fine:

#lang typed/racket

(define-type (Base-Shape R)
  (U (foo-shape R)
     (bar-shape R)))

(define-syntax (def-base-shape stx)
  (syntax-case stx ()
    [(_ (R (func-name shape-name) [param-name : param-type] ...))
     (syntax/loc stx
       (begin
         (struct (R) shape-name ([param-name : param-type] ...))
         (define #:forall (R) (func-name [param-name : param-type] ...)
           (shape-name param-name ...))))]))

(def-base-shape (R (foo-func foo-shape) [s : (Base-Shape R)]))
(def-base-shape (R (bar-func bar-shape) [s : R]))

(provide foo)
(define (foo [shapes : (Base-Shape String)])
  (foo-func shapes))

;(provide bar)
(define (bar [shapes : (Base-Shape String)])
  (bar-func shapes))


However, if you uncomment the last provide, it generates an error:

..\..\..\..\..\..\..\..\Program 
Files\Racket-6.2.900.10\share\pkgs\typed-racket-lib\typed-racket\static-contracts\optimize.rkt:155:2:
 
free-id-table-ref: no mapping for #<syntax n*11>

Is there a workaround?

Best,
António.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/3a2f30ad-218e-4684-a769-7371c069e3c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to