From 5ba9633e78286a0e436cc79909ea0fa941de07db Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 19 Jan 2015 09:48:10 -0500 Subject: [PATCH] Improve hash-table overlap. Thanks to Alex Knauth for the code and Jordan Johnson for the test case. --- typed-racket-lib/typed-racket/types/remove-intersect.rkt | 3 +++ typed-racket-test/succeed/json-hash.rkt | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 typed-racket-test/succeed/json-hash.rkt diff --git a/typed-racket-lib/typed-racket/types/remove-intersect.rkt b/typed-racket-lib/typed-racket/types/remove-intersect.rkt index 2d2cb48e..49760251 100644 --- a/typed-racket-lib/typed-racket/types/remove-intersect.rkt +++ b/typed-racket-lib/typed-racket/types/remove-intersect.rkt @@ -65,6 +65,9 @@ [(list-no-order (Value: (? simple-datum?)) (or (? Struct?) (? StructTop?) (? Function?))) #f] + [(list-no-order (Value: (not (? hash?))) + (or (? Hashtable?) (? HashtableTop?))) + #f] [(list (Struct: n _ flds _ _ _) (Struct: n* _ flds* _ _ _)) #:when (free-identifier=? n n*) diff --git a/typed-racket-test/succeed/json-hash.rkt b/typed-racket-test/succeed/json-hash.rkt new file mode 100644 index 00000000..8a07caea --- /dev/null +++ b/typed-racket-test/succeed/json-hash.rkt @@ -0,0 +1,4 @@ +#lang typed/racket/base +(require typed/json) +(: jsx JSExpr) +(define jsx #hasheq((a . "val1") (b . "val2") (c . "val3")))