Fix types of numerics etc with expected type.

This commit is contained in:
Sam Tobin-Hochstadt 2012-02-20 18:45:33 -05:00
parent 7109e92b04
commit b4af99babb

View File

@ -25,8 +25,13 @@
;; return the type of a literal value
;; scheme-value [type] -> type
(define (tc-literal v-stx [expected #f])
(define-syntax-class exp
(pattern (~and i (~or :number :str :bytes))
#:fail-unless expected #f
#:fail-unless (subtype (-val (syntax-e #'i)) expected) #f))
(define r
(syntax-parse v-stx
[i:exp expected]
[i:boolean (-val (syntax-e #'i))]
[i:identifier (-val (syntax-e #'i))]