typed-racket
typed-racket copied to clipboard
`Nothing` should be used to populate the type of the polymorphic function which has rest arguments.
What version of Racket are you using?
v8.4 [cs]
What program did you run?
> '()
- : Null
'()
> (list)
- : Null
'()
> (apply list '())
- : (Listof Nothing)
'()
> #hash()
- : (Immutable-HashTable Any Any)
'#hash()
> (hash)
- : (Immutable-HashTable Any Any)
'#hash()
> (apply hash '())
- : (Immutable-HashTable Nothing Nothing)
'#hash()
What should have happened?
> #hash()
- : (Immutable-HashTable Nothing Nothing)
'#hash()
> (hash)
- : (Immutable-HashTable Nothing Nothing)
'#hash()
More.
The problem should be in the call to the polymorphic function which has rest arguments.
> (: test0 (All (A) [-> A * (Listof A)]))
> (define test0
(λ args
(apply list args)))
> (test0)
- : (Listof Any)
'()
> (apply test0 '())
- : (Listof Nothing)
'()