fix comment, add test
svn: r18307 original commit: 1616e27b4b0a2a8cb1ad419933fdd38894c7a882
This commit is contained in:
parent
349755c446
commit
43c22f41e5
29
collects/tests/typed-scheme/fail/ht-infer.ss
Normal file
29
collects/tests/typed-scheme/fail/ht-infer.ss
Normal file
|
@ -0,0 +1,29 @@
|
|||
#lang scheme/load
|
||||
|
||||
(module before typed/scheme
|
||||
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define-struct: Sigil ())
|
||||
|
||||
(: list->english ((Listof String) -> String))
|
||||
(define (list->english strs) (error 'fail))
|
||||
|
||||
(define-type-alias (Set X) (HashTable X '()))
|
||||
|
||||
(: empty-set (All (T) (-> (Set T))))
|
||||
(define (empty-set) (error 'fail))
|
||||
|
||||
(: set->list (All (T) ((Set T) -> (Listof T))))
|
||||
(define (set->list set) (error 'fail))
|
||||
)
|
||||
|
||||
(module after typed/scheme
|
||||
(require 'before)
|
||||
|
||||
(: f ((Set Sigil) -> Any))
|
||||
(define (f x1)
|
||||
(let* ([x2 (set->list x1)])
|
||||
(list->english x2)
|
||||
(error 'NO! "Way!"))))
|
||||
|
|
@ -387,7 +387,7 @@
|
|||
[((Box: e) (Box: e*))
|
||||
(cset-meet (cg e e*) (cg e* e))]
|
||||
[((Hashtable: s1 s2) (Hashtable: t1 t2))
|
||||
;; the key is contravariant, the value is invariant
|
||||
;; for mutable hash tables, both are invariant
|
||||
(cset-meet* (list (cg t1 s1) (cg s1 t1) (cg t2 s2) (cg s2 t2)))]
|
||||
[((Syntax: s1) (Syntax: s2))
|
||||
(cg s1 s2)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user