Fix TR double cast bug

In some cases, TR tried to typecheck the contents of a quote-syntax
form that contains unexpanded syntax.

Closes PR 14355

original commit: 26204cf505f885827854908391d2842476728c8b
This commit is contained in:
Asumu Takikawa 2014-02-18 22:58:58 -05:00
parent 1fecbdb182
commit 5b642ef79d
2 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,7 @@
(private syntax-properties)
(utils tc-utils)
(for-syntax racket/base syntax/parse)
(for-template racket/base)
(rep type-rep))
(import tc-if^ tc-lambda^ tc-app^ tc-let^ tc-expr^)
@ -41,7 +42,10 @@
#'(let loop ([form init-form])
(parameterize ([current-orig-stx form])
(syntax-parse form
#:literals (quote-syntax)
[clause bodies ...] ...
;; avoid going under quote-syntax, nothing to typecheck
[(quote-syntax . rst) (void)]
[(a . b)
(loop #'a)
(loop #'b) ]

View File

@ -0,0 +1,8 @@
#lang typed/racket
;; Test for PR 14355. Ideally would be a unit test, but
;; the bug could not be triggered via the harness
;; make sure this doesn't result in an internal error
(cast (cast "x" String) String)