diff --git a/src/Compat.jl b/src/Compat.jl index 1121285110f5e..289fe87f1bd62 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -528,6 +528,9 @@ function _compat(ex::Symbol) if VERSION < v"0.4.0-dev+768" && ex === :Void return :Nothing end + if VERSION < v"0.5.0-dev+1343" && (ex == :Future || ex == :RemoteChannel) + return :RemoteRef + end return ex end _compat(ex) = ex diff --git a/test/runtests.jl b/test/runtests.jl index c59f85cfeece8..7664e204984c2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -994,3 +994,13 @@ cd(dirwalk) do end rm(dirwalk, recursive=true) + +# RemoteChannel/Future +r = remotecall(sin, 1, pi/3) +@compat foo(r::Future) = 7 +@test foo(r) == 7 +if VERSION < v"0.4.0" + @compat rc = RemoteChannel(1,2,3) +else + @compat rc = RemoteChannel{Channel{Any}}(1,2,3) +end