Add types for writeln and println

This commit is contained in:
Alexis King 2015-09-07 21:39:10 -07:00 committed by Asumu Takikawa
parent 241f04bcdb
commit 4bf3479776
2 changed files with 11 additions and 0 deletions

View File

@ -2070,7 +2070,9 @@
[write (Univ [-Output-Port] . ->opt . -Void)]
[display (Univ [-Output-Port] . ->opt . -Void)]
[print (Univ [-Output-Port (one-of/c 0 1)] . ->opt . -Void)]
[writeln (Univ [-Output-Port] . ->opt . -Void)]
[displayln (Univ [-Output-Port] . ->opt . -Void)]
[println (Univ [-Output-Port (one-of/c 0 1)] . ->opt . -Void)]
[fprintf (->* (list -Output-Port -String) Univ -Void)]
[printf (->* (list -String) Univ -Void)]
[eprintf (->* (list -String) Univ -Void)]

View File

@ -2844,6 +2844,15 @@
(display "hello" accumulator/not-thread-safe))
-Void]
;; Writing
[tc-e (writeln "hello") -Void]
[tc-e (writeln "hello" (current-output-port)) -Void]
[tc-e (displayln "hello") -Void]
[tc-e (displayln "hello" (current-output-port)) -Void]
[tc-e (println "hello") -Void]
[tc-e (println "hello" (current-output-port)) -Void]
[tc-e (println "hello" (current-output-port) 1) -Void]
;; Additional tests for recursive type aliases
[tc-e ;; The types here are valid, but uninhabitable.
(let () (define-type-alias A (Listof B))