Handle arbitrary recursive contracts generated from Rec types.

original commit: 1dca82784b664e7640053333fec85980159cbd16
This commit is contained in:
Sam Tobin-Hochstadt 2012-07-14 22:30:00 -04:00
parent 073263527c
commit 60b0b0faaa
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#;
(exn-pred exn:fail:contract? ".*expected: T.*" #rx".*contract.*\\(->.*")
(exn-pred exn:fail:contract? ".*pair?.*" #rx".*contract.*\\(->.*")
#lang scheme/load

View File

@ -214,7 +214,8 @@
(match-let ([(Mu-name: n-nm _) ty])
(with-syntax ([(n*) (generate-temporaries (list n-nm))])
(parameterize ([vars (cons (list n #'n* #'n*) (vars))])
#`(flat-rec-contract n* #,(t->c b #:flat #t)))))]
#`(letrec ([n* (recursive-contract #,(t->c b))])
n*))))]
[(Value: #f) #'false/c]
[(Instance: (Class: _ _ (list (list name fcn) ...)))
(when flat? (exit (fail)))