[plt-scheme] match doesn't recognize struct if typed

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Apr 9 12:08:07 EDT 2009

Hi all,

I have two modules, one typed, one not in which the following occurs:
foo.scm:
#lang typed-scheme

(provide (struct-out foo))

(define-struct: foo
  ((a : Integer)
   (b : Integer)))

bar.scm:
#lang scheme

(require scheme/match
         "foo.scm")

(define (bar x)
  (match x
    ((struct foo _)
     'buh)
    (_ 'xpto)))


I get:
match: foo does not refer to a structure definition in: foo

What's the issue here. if foo.scm was not typed, then everything would
be fine. Am I missing something?
I would think that if I require a typed module from an untyped one
there would be no problem whatsoever and I would just have a contract
check on module boundary.

Cheers,

-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.