diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt index 5240a90da5..3f5317968f 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt @@ -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))] diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr13937.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr13937.rkt new file mode 100644 index 0000000000..0b8ffb9db6 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr13937.rkt @@ -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))) +