|
187 | 187 | @test mi ∈ mis |
188 | 188 | @test length(mis) > 1 |
189 | 189 |
|
| 190 | + n = 5; str = LazyString("n is ", n); convert(String, str) # to ensure there are enough instances of `convert, (Type{String}, AbstractString)` |
190 | 191 | mi = methodinstance(convert, (Type{String}, String)) |
191 | 192 | mis = methodinstances(methods(convert, (Type{String}, Any))) |
192 | 193 | @test length(mis) > 10 # in fact, there are many more |
@@ -276,17 +277,19 @@ end |
276 | 277 | bes = direct_backedges(f) |
277 | 278 | @test length(bes) == 1 |
278 | 279 | pr = bes[1] |
279 | | - @test pr.first == Tuple{typeof(f),Any} |
| 280 | + @test pr.first === Tuple{typeof(f),Any} || pr.first === methodinstance(f, (Integer,)) |
280 | 281 | @test pr.second == methodinstance(applyf, (Vector{Any},)) |
281 | 282 |
|
282 | | - bes = direct_backedges(f; skip=false) |
283 | | - @test length(bes) == 2 |
284 | | - pr = bes[1] |
285 | | - @test pr.first == Tuple{typeof(f),Any} |
286 | | - @test pr.second == methodinstance(applyf, (Vector{Any},)) |
287 | | - pr = bes[2] |
288 | | - @test pr.first == methodinstance(f, (Integer,)) |
289 | | - @test pr.second == methodinstance(applyf, (Vector{Any},)) |
| 283 | + if Base.VERSION < v"1.12-DEV" |
| 284 | + bes = direct_backedges(f; skip=false) |
| 285 | + @test length(bes) == 2 |
| 286 | + pr = bes[1] |
| 287 | + @test pr.first == Tuple{typeof(f), Any} |
| 288 | + @test pr.second == methodinstance(applyf, (Vector{Any},)) |
| 289 | + pr = bes[2] |
| 290 | + @test pr.first == methodinstance(f, (Integer,)) |
| 291 | + @test pr.second == methodinstance(applyf, (Vector{Any},)) |
| 292 | + end |
290 | 293 |
|
291 | 294 | nocallers(x) = x |
292 | 295 | nocallers(3) |
|
0 commit comments