Skip to content

Commit 33728eb

Browse files
committed
Avoid needless recompilation of the generator.
1 parent 2f9b109 commit 33728eb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cache.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ function _generated_ex(world, source, ex)
4747
stub(world, source, ex)
4848
end
4949

50-
function get_world_generator(world::UInt, source, self, ::Type{Type{ft}}, ::Type{Type{tt}}) where {ft, tt}
50+
function get_world_generator(world::UInt, source, self, ft::Type, tt::Type)
5151
@nospecialize
52+
@assert Core.Compiler.isType(ft) && Core.Compiler.isType(tt)
53+
ft = ft.parameters[1]
54+
tt = tt.parameters[1]
5255

5356
# look up the method
5457
method_error = :(throw(MethodError(ft, tt, $world)))
@@ -118,8 +121,11 @@ else
118121
# on older versions of Julia we fall back to looking up the current world. this may be wrong
119122
# when the generator is invoked in a different world (TODO: when does this happen?)
120123

121-
function get_world_generator(self, ::Type{Type{ft}}, ::Type{Type{tt}}) where {ft, tt}
124+
function get_world_generator(self, ft::Type, tt::Type)
122125
@nospecialize
126+
@assert Core.Compiler.isType(ft) && Core.Compiler.isType(tt)
127+
ft = ft.parameters[1]
128+
tt = tt.parameters[1]
123129

124130
# look up the method
125131
method_error = :(throw(MethodError(ft, tt)))

0 commit comments

Comments
 (0)