From 76cb6ae53db933546834581e969d9691c26b4355 Mon Sep 17 00:00:00 2001 From: Alex Knauth Date: Sun, 3 Jul 2016 22:47:52 -0400 Subject: [PATCH] implement sc->constraints for recursive-sc (#381) --- .../typed-racket/static-contracts/structures.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/typed-racket-lib/typed-racket/static-contracts/structures.rkt b/typed-racket-lib/typed-racket/static-contracts/structures.rkt index 549605b9..71342a6f 100644 --- a/typed-racket-lib/typed-racket/static-contracts/structures.rkt +++ b/typed-racket-lib/typed-racket/static-contracts/structures.rkt @@ -105,7 +105,7 @@ ;; Takes a static contract and returns the corresponding contract. ;; The function argument should be used for sub parts of the static contract. [sc->contract sc f] - ;; sc->constraints: static-contract? (static-contract? -> constraint-set?) -> constraint-set? + ;; sc->constraints: static-contract? (static-contract? -> contract-restrict?) -> contract-restrict? ;; Takes a static contract and computes the constraint set for a static contract. ;; The function argument should be used for sub parts of the static contract. [sc->constraints sc f] @@ -139,7 +139,9 @@ [(recursive-sc names values body) (for-each (λ (v) (f v 'covariant)) values) (f body 'covariant) - (void)]))] + (void)])) + (define (sc->constraints v f) + (simple-contract-restrict 'impersonator))] #:methods gen:custom-write [(define write-proc recursive-sc-write-proc)]) ;; A use of a contract bound by recursive-sc