From d14503a2f822ed185a04e28a0f0d7ea2f871eaf5 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 13 Oct 2021 16:22:36 +0900 Subject: [PATCH] remove obscure `TypeVar` handling in `arrayref_tfunc` --- base/compiler/tfuncs.jl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index f900af273cd8dd..d60af496bdf75d 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1472,12 +1472,8 @@ end function arrayref_tfunc(@nospecialize(boundscheck), @nospecialize(a), @nospecialize i...) a = widenconst(a) if a <: Array - if isa(a, DataType) && begin - ap1 = a.parameters[1] - isa(ap1, Type) || isa(ap1, TypeVar) - end - # TODO: the TypeVar case should not be needed here - return unwraptv(ap1) + if isa(a, DataType) && (aparam1 = a.parameters[1]; isa(aparam1, Type)) + return aparam1 elseif isa(a, UnionAll) && !has_free_typevars(a) unw = unwrap_unionall(a) if isa(unw, DataType)