[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:
#lang typed-scheme

(provide (struct-out foo))

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

#lang scheme

(require scheme/match

(define (bar x)
  (match x
    ((struct foo _)
    (_ '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.


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

Posted on the users mailing list.