@@ -275,11 +275,12 @@ applyf35855(Any[1])
275275wany3 = worlds (instance (applyf35855, (Vector{Any},)))
276276src3 = code_typed (applyf35855, (Vector{Any},))[1 ]
277277@test (wany3 == wany2) == equal (src3, src2) # don't invalidate unless you also change the code
278- f35855 (:: AbstractVector ) = 4 # next test would pass if this were ::Vector{Int}
278+ f35855 (:: AbstractVector ) = 4
279279applyf35855 (Any[1 ])
280280wany4 = worlds (instance (applyf35855, (Vector{Any},)))
281281src4 = code_typed (applyf35855, (Vector{Any},))[1 ]
282- @test_broken (wany4 == wany3) == equal (src4, src3)
282+ # this passes when max_methods == 3, fails when set to 4
283+ @test (wany4 == wany3) == equal (src4, src3)
283284f35855 (:: Dict ) = 5
284285applyf35855 (Any[1 ])
285286wany5 = worlds (instance (applyf35855, (Vector{Any},)))
@@ -291,6 +292,18 @@ wany6 = worlds(instance(applyf35855, (Vector{Any},)))
291292src6 = code_typed (applyf35855, (Vector{Any},))[1 ]
292293@test (wany6 == wany5) == equal (src6, src5)
293294
295+ applyf35855_2 (c) = f35855_2 (c[1 ])
296+ f35855_2 (:: Int ) = 1
297+ f35855_2 (:: Float64 ) = 2
298+ applyf35855_2 (Any[1 ])
299+ wany3 = worlds (instance (applyf35855_2, (Vector{Any},)))
300+ src3 = code_typed (applyf35855_2, (Vector{Any},))[1 ]
301+ f35855_2 (:: AbstractVector ) = 4 # next test would pass if this were ::Vector{Int}
302+ applyf35855_2 (Any[1 ])
303+ wany4 = worlds (instance (applyf35855_2, (Vector{Any},)))
304+ src4 = code_typed (applyf35855_2, (Vector{Any},))[1 ]
305+ @test_broken (wany4 == wany3) == equal (src4, src3)
306+
294307# # ambiguities do not trigger invalidation
295308using Printf
296309Printf. gen (" %f" )
0 commit comments