From 9ba3d8113b31e06f751bad05432aeb7c882bdb4d Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Thu, 11 Feb 2021 14:29:09 +0900 Subject: [PATCH] apply suggestion --- base/essentials.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/base/essentials.jl b/base/essentials.jl index c99eaa66eb77bd..4c7e68a7e6ac69 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -257,10 +257,14 @@ end function rewrap_unionall(t::Core.TypeofVararg, @nospecialize(u)) isdefined(t, :T) || return t - if !isdefined(t, :N) || (isa(u, UnionAll) && t.N === u.var) - return Vararg{rewrap_unionall(t.T, u)} + if !isa(u, UnionAll) + return t + end + T = rewrap_unionall(t.T, u) + if !isdefined(t, :N) || t.N === u.var + return Vararg{T} end - Vararg{rewrap_unionall(t.T, u), t.N} + return Vararg{T, t.N} end # replace TypeVars in all enclosing UnionAlls with fresh TypeVars