JuliaLang/julia — pull request #8352 by danluu (2014-09-14 17:46:55+00:00)
Title: Specify ::IO for writemime

As far as I can tell, these functions pass `io` to something that requires that `io` is `::IO`, so this PR doesn't restrict the functions anymore than they're already restricted.

With the current code, there's one to two levels of indirection in the error message:
~~~
julia> writemime(STDOUT,"text/plain","halp")
"halp"

julia> writemime("bogus","text/plain","halp")
ERROR: `showlimited` has no method matching showlimited(::ASCIIString,
::ASCIIString)
in writemime at replutil.jl:2
in writemime at multimedia.jl:41

julia> writemime("bogus","bogus","halp")
ERROR: `writemime` has no method matching writemime(::ASCIIString, ::MIME{:bogus}, ::ASCIIString)
in writemime at multimedia.jl:41
~~~

With this PR, that becomes:
~~~
julia> writemime(STDOUT,"text/plain","halp")
"halp"

julia> writemime("bogus","text/plain","halp")
ERROR: `writemime` has no method matching writemime(::ASCIIString, ::ASCIIString, ::ASCIIString)

julia> writemime("bogus","bogus","halp")
ERROR: `writemime` has no method matching writemime(::ASCIIString, ::ASCIIString, ::ASCIIString)
~~~