Fix typechecking of `#%variable-reference'

This commit is contained in:
Sam Tobin-Hochstadt 2011-08-13 16:10:45 -04:00
parent 25084de5a7
commit 2d094db270
2 changed files with 30 additions and 29 deletions

View File

@ -702,7 +702,6 @@
: (-FS (-not-filter (-val #f) #'map) (-filter (-val #f) #'map))))]
;; error tests
[tc-err (#%variable-reference number?)]
[tc-err (+ 3 #f)]
[tc-err (let: ([x : Number #f]) x)]
[tc-err (let: ([x : Number #f]) (+ 1 x))]
@ -1389,6 +1388,9 @@
-Void)
[tc-e (raise (exn:fail:contract "1" (current-continuation-marks))) (t:Un)]
[tc-err (exn:fail:contract)]
[tc-e (#%variable-reference) -Variable-Reference]
[tc-e (#%variable-reference x) -Variable-Reference]
[tc-e (#%variable-reference +) -Variable-Reference]
)
(test-suite
"check-type tests"
@ -1441,4 +1443,3 @@
(define-go typecheck-tests #;tc-toplevel-tests)

View File

@ -272,9 +272,9 @@
(ret -Void))]
;; top-level variable reference - occurs at top level
[(#%top . id) (check-below (tc-id #'id) expected)]
;; weird
[(#%variable-reference . _)
(tc-error/expr #:return (ret expected) "#%variable-reference is not supported by Typed Racket")]
(ret -Variable-Reference)]
;; identifiers
[x:identifier
(check-below (tc-id #'x) expected)]
@ -389,9 +389,9 @@
[(#%top . id) (tc-id #'id)]
;; #%expression
[(#%expression e) (tc-expr #'e)]
;; weird
;; #%variable-reference
[(#%variable-reference . _)
(tc-error/expr #:return (ret (Un)) "#%variable-reference is not supported by Typed Racket")]
(ret -Variable-Reference)]
;; identifiers
[x:identifier (tc-id #'x)]
;; application