Add in-set
to Typed Racket
Closes PR 14128 original commit: 3fa3225c544160b3d2f0448012de1d7cd66b5195
This commit is contained in:
parent
b903379c2a
commit
61a18def23
|
@ -139,6 +139,9 @@
|
|||
;; in-bytes-lines
|
||||
[(make-template-identifier 'in-bytes-lines 'racket/private/for)
|
||||
(->opt [-Input-Port -Symbol] (-seq -Bytes))]
|
||||
;; in-set
|
||||
[(make-template-identifier 'in-set 'racket/private/set)
|
||||
(-poly (a) (-> (-set a) (-seq a)))]
|
||||
;; check-in-bytes-lines
|
||||
[(make-template-identifier 'check-in-bytes-lines 'racket/private/for)
|
||||
(-> Univ Univ Univ)]
|
||||
|
|
|
@ -1802,6 +1802,21 @@
|
|||
;; Unit test for PR 13298. Should raise an unbound id error
|
||||
;; instead of just allowing `x` to be undefined
|
||||
[tc-err (let () (: x Number) 3)]
|
||||
|
||||
;; Sets as sequences
|
||||
[tc-e (in-set (set 1 2 3)) (-seq -PosByte)]
|
||||
[tc-e
|
||||
(let ()
|
||||
(: lst (Listof Integer))
|
||||
(define lst
|
||||
(for/list: : (Listof Integer) ([i : Integer (set 1 2 3)]) i))
|
||||
(void))
|
||||
-Void]
|
||||
[tc-e
|
||||
(let ()
|
||||
(for: ([k : Symbol (in-set (set 'x 'y 'z))]) (displayln k))
|
||||
(void))
|
||||
-Void]
|
||||
)
|
||||
(test-suite
|
||||
"tc-literal tests"
|
||||
|
|
Loading…
Reference in New Issue
Block a user