Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in Channel put!, convert value to Channel type #29092

Merged
merged 1 commit into from
Oct 20, 2018

Commits on Sep 11, 2018

  1. in Channel put!, convert value to Channel type

    `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
    ```
    tanmaykm committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    63e84da View commit details
    Browse the repository at this point in the history