Skip to content

Commit 2b71259

Browse files
authored
inference: Make test indepdent of the Complex method table (#59105)
1 parent 2afae11 commit 2b71259

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Compiler/test/inference.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3549,8 +3549,14 @@ f31974(n::Int) = f31974(1:n)
35493549
# call cycles.
35503550
@test code_typed(f31974, Tuple{Int}) !== nothing
35513551

3552-
f_overly_abstract_complex() = Complex(Ref{Number}(1)[])
3553-
@test Base.return_types(f_overly_abstract_complex, Tuple{}) == [Complex]
3552+
# Issue #33472
3553+
struct WrapperWithUnionall33472{T<:Real}
3554+
x::T
3555+
end
3556+
3557+
f_overly_abstract33472() = WrapperWithUnionall33472(Base.inferencebarrier(1)::Number)
3558+
# Check that this doesn't infer as `WrapperWithUnionall33472{T<:Number}`.
3559+
@test Base.return_types(f_overly_abstract33472, Tuple{}) == [WrapperWithUnionall33472]
35543560

35553561
# Issue 26724
35563562
const IntRange = AbstractUnitRange{<:Integer}

0 commit comments

Comments
 (0)