https://github.com/JuliaLang/julia
Revision 06a49a392db85e1f55a1810669559389e8ecf37c authored by Simeon David Schaub on 25 April 2022, 12:30:31 UTC, committed by Simeon David Schaub on 25 April 2022, 20:15:55 UTC
Not sure whether putting hints into the lowering pass like this is a
great solution. I thought about maybe using Julia-side error hints for
this instead, but using some kind of pattern-matching doesn't seem like
a great solution either.

fixes #45031
1 parent 9d14cb1
Raw File
Tip revision: 06a49a392db85e1f55a1810669559389e8ecf37c authored by Simeon David Schaub on 25 April 2022, 12:30:31 UTC
improve error message for invalid function args
Tip revision: 06a49a3
download.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

Downloads() = require(PkgId(
        UUID((0xf43a241f_c20a_4ad4, 0x852c_f6b1247861c6)),
        "Downloads",
    ))

"""
    download(url::AbstractString, [path::AbstractString = tempname()]) -> path

Download a file from the given url, saving it to the location `path`, or if not
specified, a temporary path. Returns the path of the downloaded file.

!!! note
    Since Julia 1.6, this function is deprecated and is just a thin wrapper
    around `Downloads.download`. In new code, you should use that function
    directly instead of calling this.
"""
download(url::AbstractString, path::AbstractString) = do_download(url, path)
download(url::AbstractString) = do_download(url, nothing)

function do_download(url::AbstractString, path::Union{AbstractString, Nothing})
    depwarn("Base.download is deprecated; use Downloads.download instead", :download)
    invokelatest(Downloads().download, url, path)
end
back to top