From ce51776f1f8d7c11d76a24e330ed8d05ad0a5344 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 26 Jul 2012 21:15:42 -0700 Subject: [PATCH] Make TR's ignore-some property work even if there isn't an internal form. original commit: bb67e37c4906334dbf43e650643d9162d195fa3d --- .../typed-racket/typecheck/check-subforms-unit.rkt | 4 ++-- collects/typed-racket/typecheck/tc-expr-unit.rkt | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/collects/typed-racket/typecheck/check-subforms-unit.rkt b/collects/typed-racket/typecheck/check-subforms-unit.rkt index 088ea6e9..1b954b87 100644 --- a/collects/typed-racket/typecheck/check-subforms-unit.rkt +++ b/collects/typed-racket/typecheck/check-subforms-unit.rkt @@ -100,7 +100,7 @@ expected) ;; typecheck the expansion of a with-handlers form -;; syntax -> any +;; syntax -> void (define (check-subforms/ignore form) (let loop ([form form]) (kernel-syntax-case* form #f () @@ -108,7 +108,7 @@ ;; if this needs to be checked (syntax-property form 'typechecker:with-type) ;; the form should be already ascribed the relevant type - (tc-expr form)] + (void (tc-expr form))] [(a . b) (loop #'a) (loop #'b)] diff --git a/collects/typed-racket/typecheck/tc-expr-unit.rkt b/collects/typed-racket/typecheck/tc-expr-unit.rkt index 735814ca..e4a18662 100644 --- a/collects/typed-racket/typecheck/tc-expr-unit.rkt +++ b/collects/typed-racket/typecheck/tc-expr-unit.rkt @@ -286,10 +286,9 @@ (check-subforms/with-handlers/check form expected)] [stx #:when (syntax-property form 'typechecker:ignore-some) - (let ([ty (check-subforms/ignore form)]) - (unless ty - (int-err "internal error: ignore-some")) - (check-below ty expected))] + (check-subforms/ignore form) + ;; We trust ignore to be only on syntax objects objects that are well typed + expected] ;; explicit failure [(quote-syntax ((~literal typecheck-fail-internal) stx msg:str var)) (explicit-fail #'stx #'msg #'var)] @@ -397,10 +396,8 @@ ty)] [stx #:when (syntax-property form 'typechecker:ignore-some) - (let ([ty (check-subforms/ignore form)]) - (unless ty - (int-err "internal error: ignore-some")) - ty)] + (check-subforms/ignore form) + Univ] ;; explicit failure [(quote-syntax ((~literal typecheck-fail-internal) stx msg var)) (explicit-fail #'stx #'msg #'var)]