TR: Fix type-checking of hash literals.

original commit: abf9223203d373840adb4bba0495dac7aa422517
This commit is contained in:
Asumu Takikawa 2012-05-23 15:18:27 -04:00
parent 8fdb647233
commit ece68f93e3
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
#lang typed/racket
(define: x : (HashTable String String) #hash())
(ann #hash() (HashTable String String))

View File

@ -111,7 +111,7 @@
(let* ([h (syntax-e #'i)]
[ks (hash-map h (lambda (x y) (tc-literal x k)))]
[vs (hash-map h (lambda (x y) (tc-literal y v)))])
(make-Hashtable (generalize (check-below (apply Un ks)) k) (generalize (check-below (apply Un vs)))))]
(make-Hashtable (generalize (check-below (apply Un ks) k)) (generalize (check-below (apply Un vs) v))))]
[_ (let* ([h (syntax-e #'i)]
[ks (hash-map h (lambda (x y) (tc-literal x)))]
[vs (hash-map h (lambda (x y) (tc-literal y)))])