From 629b3119b85f7f08e12821d9d84b8028be0053f9 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 7 Nov 2014 15:11:47 -0500 Subject: [PATCH] Document surprising control flow. --- .../typed-racket-lib/typed-racket/typecheck/tc-envops.rkt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-envops.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-envops.rkt index 4f6283c796..67fdf3a8aa 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-envops.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-envops.rkt @@ -82,6 +82,7 @@ ;; run code in an extended env and with replaced props. Requires the body to return a tc-results. ;; TODO make this only add the new prop instead of the entire environment once tc-id is fixed to ;; include the interesting props in its filter. +;; WARNING: this may bail out when code is unreachable (define-syntax (with-lexical-env/extend-props stx) (define-splicing-syntax-class unreachable? (pattern (~seq #:unreachable form:expr)) @@ -92,6 +93,7 @@ (if new-env (with-lexical-env new-env (add-unconditional-prop (let () . b) (apply -and (append atoms (env-props new-env))))) + ;; unreachable, bail out (let () u.form (ret -Bottom))))]))