@@ -295,12 +295,12 @@ function evaluate_methoddef(frame, node)
295
295
end
296
296
length (node. args) == 1 && return f
297
297
sig = @lookup (frame, node. args[2 ]):: SimpleVector
298
- body = @lookup (frame, node. args[3 ])
298
+ body = @lookup (frame, node. args[3 ]):: Union{CodeInfo, Expr}
299
299
# branching on https://github.com/JuliaLang/julia/pull/41137
300
300
@static if isdefined (Core. Compiler, :OverlayMethodTable )
301
- ccall (:jl_method_def , Cvoid, (Any, Ptr{Cvoid}, Any, Any), sig, C_NULL , body, moduleof (frame))
301
+ ccall (:jl_method_def , Cvoid, (Any, Ptr{Cvoid}, Any, Any), sig, C_NULL , body, moduleof (frame):: Module )
302
302
else
303
- ccall (:jl_method_def , Cvoid, (Any, Any, Any), sig, body, moduleof (frame))
303
+ ccall (:jl_method_def , Cvoid, (Any, Any, Any), sig, body, moduleof (frame):: Module )
304
304
end
305
305
return f
306
306
end
@@ -318,8 +318,8 @@ function structname(frame, node)
318
318
end
319
319
320
320
function set_structtype_const (mod:: Module , name:: Symbol )
321
- dt = Base. unwrap_unionall (getfield (mod, name))
322
- ccall (:jl_set_const , Cvoid, (Any, Any, Any), mod, dt. name. name, dt. name. wrapper)
321
+ dt = Base. unwrap_unionall (getfield (mod, name)):: DataType
322
+ ccall (:jl_set_const , Cvoid, (Any, Any, Any), mod, dt. name. name:: Symbol , dt. name. wrapper)
323
323
end
324
324
325
325
function inplace_lookup! (ex, i, frame)
@@ -378,12 +378,14 @@ function eval_rhs(@nospecialize(recurse), frame, node::Expr)
378
378
args = let mod= mod
379
379
Any[@lookup (mod, frame, arg) for arg in node. args]
380
380
end
381
- T = popfirst! (args)
381
+ T = popfirst! (args):: DataType
382
382
rhs = ccall (:jl_new_structv , Any, (Any, Ptr{Any}, UInt32), T, args, length (args))
383
383
return rhs
384
384
elseif head === :splatnew # Julia 1.2+
385
385
mod = moduleof (frame)
386
- rhs = ccall (:jl_new_structt , Any, (Any, Any), @lookup (mod, frame, node. args[1 ]), @lookup (mod, frame, node. args[2 ]))
386
+ T = @lookup (mod, frame, node. args[1 ]):: DataType
387
+ args = @lookup (mod, frame, node. args[2 ]):: Tuple
388
+ rhs = ccall (:jl_new_structt , Any, (Any, Any), T, args)
387
389
return rhs
388
390
elseif head === :isdefined
389
391
return check_isdefined (frame, node. args[1 ])
0 commit comments