From bd6607e4cd555cbeb8acf008712a549d42fd9c40 Mon Sep 17 00:00:00 2001 From: ScottPJones Date: Sun, 27 Mar 2016 23:01:23 -0400 Subject: [PATCH] Make fix conditional on version --- src/misc.jl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/misc.jl b/src/misc.jl index 212f0e7b..d251d6a0 100644 --- a/src/misc.jl +++ b/src/misc.jl @@ -24,15 +24,14 @@ function Maybe(T::Type) end function in_expr_args(ex::Expr) - if ex.head === :in + ex.head === :in && return ex.args[1], ex.args[2] +if VERSION < v"0.5.0-dev+3200" + (ex.head === :comparison && length(ex.args) == 3 && ex.args[2] === :in) && return ex.args[1], ex.args[2] - elseif (ex.head === :comparison && length(ex.args) == 3 && - ex.args[2] === :in) - return ex.args[1], ex.args[3] - elseif (ex.head === :call && length(ex.args) == 3 && - ex.args[1] === :in) +else + (ex.head === :call && length(ex.args) == 3 && ex.args[1] === :in) && return ex.args[2], ex.args[3] - end +end error("Not an `in` expression") end