Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new hash match pattern doesn't work in Typed Racket #1363

Closed
shawnw opened this issue Feb 20, 2024 · 0 comments · Fixed by #1364
Closed

The new hash match pattern doesn't work in Typed Racket #1363

shawnw opened this issue Feb 20, 2024 · 0 comments · Fixed by #1364
Assignees

Comments

@shawnw
Copy link

shawnw commented Feb 20, 2024

#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))
@sorawee sorawee transferred this issue from racket/racket Feb 20, 2024
@sorawee sorawee self-assigned this Feb 20, 2024
sorawee added a commit to sorawee/typed-racket that referenced this issue Mar 7, 2024
sorawee added a commit to sorawee/typed-racket that referenced this issue Mar 14, 2024
sorawee added a commit to sorawee/typed-racket that referenced this issue Mar 19, 2024
sorawee added a commit to sorawee/typed-racket that referenced this issue Mar 21, 2024
sorawee added a commit that referenced this issue Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants