2
votes

I'm trying to match against a hash table in typed racket, but I keep getting the following error. The code works fine in untyped racket and I've tried changing it up some to no effect. The error looks like it's happening somewhere after the match macro gets expanded but I'm not familiar enough with racket to understand where or how to debug the issue.

Is is possible to use the hash-table pattern in typed racket?

(match (make-hash '((a . 2) (b . 3) (c . 2)))
    [(hash-table _ ...) #t])
Type Checker: Polymorphic function `hash-map' could not be applied to arguments:
Domains: HashTableTop (-> Any Any c) Any 
         HashTableTop (-> Any Any c) 
         (HashTable a b) (-> a b c) Any 
         (HashTable a b) (-> a b c) 
Arguments: (Mutable-HashTable Symbol Integer) (All (a) (-> a * (Listof a)))