Skip to content

Commit 93c6061

Browse files
ranjananJeffBezanson
authored andcommitted
test for #17811, type of e.g. abs(Integer[]) (#17891)
This tests that the result type of an empty comprehension is big enough to hold the possible results.
1 parent 29e7ddf commit 93c6061

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/inference.jl

+8
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,11 @@ end
274274
let f(x) = (x===nothing) ? 1 : 1.0
275275
@test Base.return_types(f, (Void,)) == Any[Int]
276276
end
277+
278+
# Issue #17811
279+
let I = Integer[]
280+
I = abs(I)
281+
@test typeof(I) == Array{Any,1}
282+
push!(I, 1)
283+
@test I == Any[1]
284+
end

0 commit comments

Comments
 (0)