From bf517fd99f435da6276416bd027d0ae4ac87c0e5 Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Fri, 10 Jun 2016 13:26:04 -0400 Subject: [PATCH] don't use this-syntax in type pattern-expanders --- tapl/typecheck.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tapl/typecheck.rkt b/tapl/typecheck.rkt index 82fc3b0..9258e22 100644 --- a/tapl/typecheck.rkt +++ b/tapl/typecheck.rkt @@ -557,7 +557,8 @@ #'(~and expanded-τ (~Any/bvs (~literal/else τ-internal (format "Expected ~a type, got: ~a" - 'τ (type->str #'expanded-τ))) + 'τ (type->str #'expanded-τ)) + #'expanded-τ) (~and bvs (tv (... (... ...)))) . rst) #,(if (attribute has-bvs?) @@ -573,7 +574,8 @@ #'(~and expanded-τ (~Any/bvs (~literal/else τ-internal (format "Expected ~a type, got: ~a" - 'τ (type->str #'expanded-τ))) + 'τ (type->str #'expanded-τ)) + #'expanded-τ) bvs-pat . pat))]))) (define-syntax τ-expander* @@ -747,13 +749,13 @@ (define-syntax ~literal/else (pattern-expander (syntax-parser - [(_ lit:id fail-msg:expr) + [(_ lit:id fail-msg:expr stx) #'(~and actual (~parse (~fail #:unless (and (identifier? #'actual) (free-identifier=? #'actual #'lit)) fail-msg) - this-syntax))]))) + stx))]))) ; subst τ for y in e, if (bound-id=? x y) (define (subst τ x e [cmp bound-identifier=?]) (syntax-parse e