From 73e0ccc1fea24913b6cc58e52b4e0c6800533643 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Wed, 2 Feb 2022 23:07:40 -0500 Subject: [PATCH] Update runtests.jl https://github.com/JuliaLang/julia/pull/43852 will improve inference making it realize that `_zero(::Missing)` throws such that `_sum` can never return `missing`, breaking the inference test below because the return type is more precise than expected. --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 7a2ccf5..b0935d0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -190,7 +190,7 @@ end @test eltype(mappedarray(identity, [missing, 1])) == Union{Missing, Int} # ReadonlyMappedArray and MappedArray - _zero(x) = x > 0 ? x : 0 + _zero(x) = ismissing(x) ? x : (x > 0 ? x : 0) @test eltype(mappedarray(_zero, [1, 1.0])) == Union{Float64,Int} @test eltype(mappedarray(_zero, [1.0, 1])) == Union{Float64,Int} @test eltype(mappedarray(_zero, [1, 1])) == Int