From be8224b912569be78ce3034068031451b776c44d Mon Sep 17 00:00:00 2001 From: Lucas C Wilcox Date: Tue, 19 Mar 2019 14:07:04 -0700 Subject: [PATCH] Version check workaround for JuliaLang/julia#29970 The workaround for JuliaLang/julia#29970 causes newer versions of Julia to hang in the precompilation step for TypedTables. Since JuliaLang/julia#29970 has been addressed in JuliaLang/julia#30577 the code is avoided in newer versions of Julia. --- src/TypedTables.jl | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/TypedTables.jl b/src/TypedTables.jl index 0e72884..d9f2024 100644 --- a/src/TypedTables.jl +++ b/src/TypedTables.jl @@ -22,15 +22,20 @@ end _ndims(a::NamedTuple{<:Any, T}) where {T} = _ndims(T) _ndims(::Type{<:Tuple{Vararg{AbstractArray{<:Any, n}}}}) where {n} = n -# Workaround for JuliaLang/julia#29970 -let - for n in 1:32 - Ts = [Symbol("T$i") for i in 1:n] - xs = [:(x[$i]) for i in 1:n] - NT = :(Core.NamedTuple{names, Tuple{$(Ts...)}}) - eval(quote - $NT(x::Tuple{$(Ts...)}) where {names, $(Ts...)} = $(Expr(:new, NT, xs...)) - end) +# The following code causes newer versions of Julia to hang in precompilation +# and the workaround should not be needed after JuliaLang/julia#30577 was +# merged. +if VERSION < v"1.2.0-DEV.291" + # Workaround for JuliaLang/julia#29970 + let + for n in 1:32 + Ts = [Symbol("T$i") for i in 1:n] + xs = [:(x[$i]) for i in 1:n] + NT = :(Core.NamedTuple{names, Tuple{$(Ts...)}}) + eval(quote + $NT(x::Tuple{$(Ts...)}) where {names, $(Ts...)} = $(Expr(:new, NT, xs...)) + end) + end end end