From d7ef7a2bad5bc2ad4a8d737c157979bb456aa122 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 28 May 2010 15:11:45 -0400 Subject: [PATCH] Disabled multi-valued seq-exprs in the for: macros because using them triggers an internal error in the typechecker. original commit: e9a00146303991e4517fc0f406c484f1f6cca646 --- collects/tests/typed-scheme/xfail/for-inference.rkt | 12 +++++++++--- collects/typed-scheme/private/for-clauses.rkt | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/collects/tests/typed-scheme/xfail/for-inference.rkt b/collects/tests/typed-scheme/xfail/for-inference.rkt index e120ee01..faa0154b 100644 --- a/collects/tests/typed-scheme/xfail/for-inference.rkt +++ b/collects/tests/typed-scheme/xfail/for-inference.rkt @@ -10,6 +10,7 @@ ;; matter how many #:when clauses we throw at them. ;; Of course, for*/list: and co won't work, since they are equivalent ;; to for/list: and co with #:when clauses. +;; These are currently documented as not working. (for/list: : (Listof Integer) ((i : Exact-Positive-Integer '(1 2 3)) #:when (odd? i) @@ -27,8 +28,10 @@ (j : Exact-Positive-Integer '(10 20 30))) (list i j)) -;; The right type for the return value would be (values (Listof Integer) (Listof Integer)). -;; The problem here is with the error message. Somehow, source location information is lost and the whole module is blamed. +;; The right type for the return value would be: +;; (values (Listof Integer) (Listof Integer)). +;; The problem here is with the error message. Somehow, source location +;; information is lost and the whole module is blamed. (for/lists: : (Listof Integer) ((x : (Listof Integer)) (y : (Listof Integer))) @@ -36,7 +39,10 @@ (j : Exact-Positive-Integer '(10 20 30))) (values i j)) -;; This is a legitimate use of multi-valued seq-exprs, but it causes the typechecker to throw an internal error. +;; This is a legitimate use of multi-valued seq-exprs, but it causes +;; the typechecker to throw an internal error. +;; Multi-valued seq-exprs are currently turned off and documented as +;; not working. (for/list: : (Listof Integer) ((([i : Exact-Positive-Integer] [j : Exact-Positive-Integer]) diff --git a/collects/typed-scheme/private/for-clauses.rkt b/collects/typed-scheme/private/for-clauses.rkt index c45cc95f..83c7f36b 100644 --- a/collects/typed-scheme/private/for-clauses.rkt +++ b/collects/typed-scheme/private/for-clauses.rkt @@ -11,7 +11,8 @@ (pattern (var:annotated-name seq-expr:expr) #:with (expand ...) (list #'(var.ann-name seq-expr))) ;; multi-valued seq-expr - (pattern ((v:annotated-name ...) seq-expr:expr) + ;; currently disabled because it triggers an internal error in the typechecker + #;(pattern (((v:annotated-name) ...) seq-expr:expr) #:with (expand ...) (list #'((v.ann-name ...) seq-expr))) ;; when clause (pattern (~seq #:when guard:expr) @@ -23,7 +24,8 @@ (pattern (var:annotated-name seq-expr:expr) #:with (expand ...) (list #'(var.ann-name seq-expr) #'#:when #'#t)) ;; multi-valued seq-expr - (pattern ((v:annotated-name ...) seq-expr:expr) + ;; currently disabled because it triggers an internal error in the typechecker + #;(pattern (((v:annotated-name) ...) seq-expr:expr) #:with (expand ...) (list #'((v.ann-name ...) seq-expr) #'#:when #'#t)) ;; when clause (pattern (~seq #:when guard:expr)