Add in-set
to Typed Racket
Closes PR 14128
This commit is contained in:
parent
a3a04387fa
commit
3fa3225c54
|
@ -139,6 +139,9 @@
|
||||||
;; in-bytes-lines
|
;; in-bytes-lines
|
||||||
[(make-template-identifier 'in-bytes-lines 'racket/private/for)
|
[(make-template-identifier 'in-bytes-lines 'racket/private/for)
|
||||||
(->opt [-Input-Port -Symbol] (-seq -Bytes))]
|
(->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
|
;; check-in-bytes-lines
|
||||||
[(make-template-identifier 'check-in-bytes-lines 'racket/private/for)
|
[(make-template-identifier 'check-in-bytes-lines 'racket/private/for)
|
||||||
(-> Univ Univ Univ)]
|
(-> Univ Univ Univ)]
|
||||||
|
|
|
@ -1802,6 +1802,21 @@
|
||||||
;; Unit test for PR 13298. Should raise an unbound id error
|
;; Unit test for PR 13298. Should raise an unbound id error
|
||||||
;; instead of just allowing `x` to be undefined
|
;; instead of just allowing `x` to be undefined
|
||||||
[tc-err (let () (: x Number) 3)]
|
[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
|
(test-suite
|
||||||
"tc-literal tests"
|
"tc-literal tests"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user