Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
No code change is needed, but the use-case in that issue doesn't
appear to be tested directly.

Closes JuliaLang#38149
  • Loading branch information
timholy authored and LilithHafner committed Feb 22, 2022
1 parent 10a9a8f commit 8779ef4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -875,3 +875,19 @@ precompile_test_harness("Renamed Imports") do load_path
Base.compilecache(Base.PkgId("RenameImports"))
@test (@eval (using RenameImports; RenameImports.test())) isa Module
end

@testset "issue 38149" begin
M = Module()
@eval M begin
@nospecialize
f(x, y) = x + y
f(x::Int, y) = 2x + y
end
precompile(M.f, (Int, Any))
precompile(M.f, (AbstractFloat, Any))
mis = map(methods(M.f)) do m
m.specializations[1]
end
@test any(mi -> mi.specTypes.parameters[2] === Any, mis)
@test all(mi -> isa(mi.cache, Core.CodeInstance), mis)
end

0 comments on commit 8779ef4

Please sign in to comment.