typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

A problem caused by `hash-iterate-key+value`

Open NoahStoryM opened this issue 3 years ago • 0 comments

What version of Racket are you using?

v8.2

What program did you run?

#lang typed/racket/base

(module untype racket/base
  (provide func)
  (define (func arg)
    (displayln '--------------)
    (displayln arg)
    (newline)
    (for ([(k v) (in-hash arg)]) (void))))

(require/typed 'untype
  [func [-> Any Any]])

(func '#hasheq([null . 1]))
(func '#hasheq([() . 1]))
(func '#hasheq(['() . 1]))

What should have happened?

print:

--------------
#hasheq((null . 1))

--------------
#hasheq((() . 1))

--------------
#hasheq(((quote ()) . 1))

If you got an error message, please include it here.

--------------
#hasheq((null . 1))

--------------
#hasheq((() . 1))

--------------
#hasheq()

hash-iterate-key+value: no value found for post-impersonator key
  key: ''()
  context...:
   /home/noah/Desktop/Codes/Racket/draft.rkt:5:2: func
   /usr/share/racket/collects/racket/contract/private/arrow-higher-order.rkt:379:33
   body of "/home/noah/Desktop/Codes/Racket/draft.rkt"

I guess the problem may be related to https://github.com/racket/racket/pull/1224

NoahStoryM avatar Nov 06 '21 14:11 NoahStoryM