From 5fc28b199390d2b6b66bb2de758b72b290a3f875 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 24 Aug 2023 14:12:05 -0400 Subject: [PATCH] fix #50562, regression in `in` of tuple of Symbols (#51009) fix #50562 --- base/tuple.jl | 1 - test/tuple.jl | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base/tuple.jl b/base/tuple.jl index 59fe2c1e531e1a..ae5de415868482 100644 --- a/base/tuple.jl +++ b/base/tuple.jl @@ -607,7 +607,6 @@ any(x::Tuple{Bool, Bool, Bool}) = x[1]|x[2]|x[3] # a version of `in` esp. for NamedTuple, to make it pure, and not compiled for each tuple length function sym_in(x::Symbol, @nospecialize itr::Tuple{Vararg{Symbol}}) - @noinline @_total_meta for y in itr y === x && return true diff --git a/test/tuple.jl b/test/tuple.jl index 8ff311928b6b83..b806667fd9d0aa 100644 --- a/test/tuple.jl +++ b/test/tuple.jl @@ -763,6 +763,12 @@ g42457(a, b) = Base.isequal(a, b) ? 1 : 2.0 # issue #46049: setindex(::Tuple) regression @inferred Base.setindex((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), 42, 1) +# issue #50562 +f50562(r) = in(:i_backward, r[]) +r50562 = Ref((:b_back, :foofakgka, :i_backw)) +f50562(r50562) +@test @allocated(f50562(r50562)) == 0 + # issue #47326 function fun1_47326(args...) head..., tail = args