Add type for in-hash-pairs
Related to PR 13937
This commit is contained in:
parent
e5e6d097be
commit
992a14ccb5
|
@ -116,6 +116,10 @@
|
|||
(-poly (a b)
|
||||
(cl-> [((-HT a b)) (-seq b)]
|
||||
[(-HashTop) (-seq Univ)]))]
|
||||
[(make-template-identifier 'in-hash-pairs 'racket/private/for)
|
||||
(-poly (a b)
|
||||
(cl-> [((-HT a b)) (-seq (-pair a b))]
|
||||
[(-HashTop) (-seq (-pair Univ Univ))]))]
|
||||
;; in-port
|
||||
[(make-template-identifier 'in-port 'racket/private/for)
|
||||
(->opt [(-> -Input-Port Univ) -Input-Port] (-seq Univ))]
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#lang typed/racket
|
||||
|
||||
;; Test for PR 13937
|
||||
|
||||
;; This does not directly test the issue in PR 13937, but
|
||||
;; tests a workaround using `in-hash-pairs`.
|
||||
;;
|
||||
;; This should be a unit test, but the typecheck tests do
|
||||
;; not play nice with base-special-env bindings like `in-hash-pairs`
|
||||
;;
|
||||
(for/hash: : (HashTable Symbol Integer)
|
||||
([p : (Pairof Symbol Integer) (in-hash-pairs #hash((a . 5)))])
|
||||
(values (car p) (cdr p)))
|
||||
|
Loading…
Reference in New Issue
Block a user