typed-racket
typed-racket copied to clipboard
The new hash match pattern doesn't work in Typed Racket
#lang typed/racket
(match '#hash((a . 2))
[(hash 'a _) #t]
[_ #f])
produces the following error on Racket 8.12:
Type Checker: missing type for identifier;
consider using `require/typed' to import it
identifier: hash-state
from module: runtime.rkt in: (match (quote #hash((a . 2))) ((hash (quote a) _) #t) (_ #f))
and
(match '#hash((a . 2))
[(hash 'a _ #:open) #t]
[_ #f])
gives
Type Checker: missing type for identifier;
consider using `require/typed' to import it
identifier: undef
from module: runtime.rkt in: (match (quote #hash((a . 2))) ((hash (quote a) _ #:open) #t) (_ #f))
. Type Checker: missing type for identifier;
consider using `require/typed' to import it
identifier: undef?
from module: runtime.rkt in: (match (quote #hash((a . 2))) ((hash (quote a) _ #:open) #t) (_ #f))
. Type Checker: Summary: 2 errors encountered in:
(match (quote #hash((a . 2))) ((hash (quote a) _ #:open) #t) (_ #f))
(match (quote #hash((a . 2))) ((hash (quote a) _ #:open) #t) (_ #f))