Skip to content

Commit

Permalink
Warn about unreachable methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Apr 16, 2024
1 parent edf42ab commit 81190ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ macro in_world(world, ex)
end

function compile_method_instance(@nospecialize(job::CompilerJob))
if job.source.def.primary_world > job.world || job.world > job.source.def.deleted_world
error("Cannot compile $(job.source) for world $(job.world); method is only valid in worlds $(job.source.def.primary_world) to $(job.source.def.deleted_world)")
end

# populate the cache
interp = get_interpreter(job)
cache = CC.code_cache(interp)
Expand Down

0 comments on commit 81190ed

Please sign in to comment.