From e1687c4ea5c7f7626e8180ccc77b85d8d7c4add1 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 25 Aug 2020 17:26:56 +0200 Subject: [PATCH] Fix `builtin_tfunction` for `Core._expr` (#37188) --- base/compiler/tfuncs.jl | 2 +- test/compiler/inference.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 8b52c6e216f0fe..9ab8f56d313923 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1412,7 +1412,7 @@ function builtin_tfunction(interp::AbstractInterpreter, @nospecialize(f), argtyp end end return Any - elseif f === Expr + elseif f === Core._expr if length(argtypes) < 1 && !isva return Bottom end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 46046d65795773..95050f1179e759 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2738,3 +2738,5 @@ f_generator_splat(t::Tuple) = tuple((identity(l) for l in t)...) @test (sizeof(Ptr),) == sizeof.((Ptr,)) == sizeof.((Ptr{Cvoid},)) @test Core.Compiler.sizeof_tfunc(UnionAll) === Int @test !Core.Compiler.sizeof_nothrow(UnionAll) + +@test Base.return_types(Expr) == Any[Expr]