Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in Channel
put!
, convert value to Channel type (#29092)
`put!(ch::Channel{T}, v)` should convert `v` to type `T`. This can prevent errors like: ``` julia> c = Channel{Int}(0) Channel{Int64}(sz_max:0,sz_curr:0) julia> @async put!(c, :a) Task (runnable) @0x00007ff5b9d79270 julia> isready(c) && take!(c) ERROR: TypeError: in take_unbuffered, in typeassert, expected Int64, got Symbol Stacktrace: [1] take_unbuffered(::Channel{Int64}) at ./channels.jl:323 [2] take!(::Channel{Int64}) at ./channels.jl:306 [3] top-level scope at none:0 ```
- Loading branch information