Fix check-unreachable-code? mode in TR

This commit is contained in:
Asumu Takikawa 2014-06-11 16:32:02 -04:00
parent 6695ccc8cd
commit 07c944f337
2 changed files with 18 additions and 1 deletions

View File

@ -25,7 +25,7 @@
;; otherwise, this code is unreachable
;; and the resulting type should be the empty type
[(check-unreachable-code?)
(tc-expr/check expr Univ)
(tc-expr expr)
(ret (Un))]
[else (ret (Un))]))
(match (single-value tst)

View File

@ -0,0 +1,17 @@
#;
(exn-pred #rx"expected: Symbol.*given: String")
#lang racket/load
;; This test makes sure that the check-unreachable-code mode
;; actually works.
(require (for-syntax typed-racket/utils/tc-utils))
(begin-for-syntax
(check-unreachable-code? #t))
(require typed/racket)
(if #t
"foo"
(symbol->string "foo"))