From 7f47df64ffc7307e6723942884899313280bf07a Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Sat, 1 Dec 2018 14:46:08 +1300 Subject: [PATCH] News and compat annotation for #29092 (convert in put!(::Channel{T}, v)) --- NEWS.md | 1 + base/channels.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index b89948ecbee30..7382253709708 100644 --- a/NEWS.md +++ b/NEWS.md @@ -81,6 +81,7 @@ Standard library changes * `range` now accept `stop` as a positional argument ([#28708]). * `parse(Bool, str)` is now supported ([#29997]). * `copyto!(::AbstractMatrix, ::UniformScaling)` supports rectangular matrices now ([#28790]). + * In `put!(c::Channel{T}, v)`, `v` now gets converted to `T` as `put!` is being called ([#29092]). Compiler/Runtime improvements ----------------------------- diff --git a/base/channels.jl b/base/channels.jl index f43d74f75c921..090fad3ad877f 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -245,6 +245,9 @@ Append an item `v` to the channel `c`. Blocks if the channel is full. For unbuffered channels, blocks until a [`take!`](@ref) is performed by a different task. + +!!! compat "Julia 1.1" + `v` now gets converted to the channel's type with [`convert`](@ref) as `put!` is called. """ function put!(c::Channel{T}, v) where T check_channel_state(c)