Skip to content

Commit 0f24ba2

Browse files
authored
fix module redefinition warning when running tests (#41905)
1 parent 6e0bac9 commit 0f24ba2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/compiler/inference.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,14 +3005,14 @@ end
30053005
# Some very limited testing of timing the type inference (#37749).
30063006
@testset "Core.Compiler.Timings" begin
30073007
# Functions that call each other
3008-
@eval module M
3008+
@eval module M1
30093009
i(x) = x+5
30103010
i2(x) = x+2
30113011
h(a::Array) = i2(a[1]::Integer) + i(a[1]::Integer) + 2
30123012
g(y::Integer, x) = h(Any[y]) + Int(x)
30133013
end
30143014
timing1 = time_inference() do
3015-
@eval M.g(2, 3.0)
3015+
@eval M1.g(2, 3.0)
30163016
end
30173017
@test occursin(r"Core.Compiler.Timings.Timing\(InferenceFrameInfo for Core.Compiler.Timings.ROOT\(\)\) with \d+ children", sprint(show, timing1))
30183018
# The last two functions to be inferred should be `i` and `i2`, inferred at runtime with
@@ -3024,11 +3024,11 @@ end
30243024
@test isa(stacktrace(timing1.children[1].bt), Vector{Base.StackTraces.StackFrame})
30253025
# Test that inference has cached some of the Method Instances
30263026
timing2 = time_inference() do
3027-
@eval M.g(2, 3.0)
3027+
@eval M1.g(2, 3.0)
30283028
end
30293029
@test length(flatten_times(timing2)) < length(flatten_times(timing1))
30303030
# Printing of InferenceFrameInfo for mi.def isa Module
3031-
@eval module M
3031+
@eval module M2
30323032
i(x) = x+5
30333033
i2(x) = x+2
30343034
h(a::Array) = i2(a[1]::Integer) + i(a[1]::Integer) + 2
@@ -3038,7 +3038,7 @@ end
30383038
timingmod = time_inference() do
30393039
@eval @testset "Outer" begin
30403040
@testset "Inner" begin
3041-
for i = 1:2 M.g(2, 3.0) end
3041+
for i = 1:2 M2.g(2, 3.0) end
30423042
end
30433043
end
30443044
end

0 commit comments

Comments
 (0)