typed-racket/typed-racket-test/succeed/pr390-variation-6.rkt
Ben Greenman 6c2a7eb512 patch: check duplicates before making an or/c for hash keys
The contract for `(U (I-Hash k1 v1) (M-Hash k2 v2) (W-Hash k3 v3))`
 is now `(hash/c (or/c k1 k2 k3) (or/c v1 v2 v3))`
 ONLY WHEN the key and value types are distinct.
The contract should no longer include duplicate key or value types.
2017-06-27 01:38:18 -04:00

10 lines
186 B
Racket

#lang racket/base
(module t typed/racket
(provide h)
(define h : (U (Immutable-HashTable Symbol Any) (Mutable-HashTable Symbol Any))
(hash 'a 1)))
(require 't)
(hash-ref h 'a)