diff --git a/base/channels.jl b/base/channels.jl index aa4d913dcdadd..07f1975bcee81 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -183,7 +183,7 @@ Close a channel. An exception (optionally given by `excp`), is thrown by: * [`put!`](@ref) on a closed channel. * [`take!`](@ref) and [`fetch`](@ref) on an empty, closed channel. """ -function close(c::Channel, excp::Exception=closed_exception()) +function close(c::Channel, @nospecialize(excp::Exception=closed_exception())) lock(c) try c.excp = excp