diff --git a/src/interpret.jl b/src/interpret.jl index 1788e707..56578942 100644 --- a/src/interpret.jl +++ b/src/interpret.jl @@ -295,12 +295,12 @@ function evaluate_methoddef(frame, node) end length(node.args) == 1 && return f sig = @lookup(frame, node.args[2])::SimpleVector - body = @lookup(frame, node.args[3]) + body = @lookup(frame, node.args[3])::Union{CodeInfo, Expr} # branching on https://github.com/JuliaLang/julia/pull/41137 @static if isdefined(Core.Compiler, :OverlayMethodTable) - ccall(:jl_method_def, Cvoid, (Any, Ptr{Cvoid}, Any, Any), sig, C_NULL, body, moduleof(frame)) + ccall(:jl_method_def, Cvoid, (Any, Ptr{Cvoid}, Any, Any), sig, C_NULL, body, moduleof(frame)::Module) else - ccall(:jl_method_def, Cvoid, (Any, Any, Any), sig, body, moduleof(frame)) + ccall(:jl_method_def, Cvoid, (Any, Any, Any), sig, body, moduleof(frame)::Module) end return f end @@ -318,8 +318,8 @@ function structname(frame, node) end function set_structtype_const(mod::Module, name::Symbol) - dt = Base.unwrap_unionall(getfield(mod, name)) - ccall(:jl_set_const, Cvoid, (Any, Any, Any), mod, dt.name.name, dt.name.wrapper) + dt = Base.unwrap_unionall(getfield(mod, name))::DataType + ccall(:jl_set_const, Cvoid, (Any, Any, Any), mod, dt.name.name::Symbol, dt.name.wrapper) end function inplace_lookup!(ex, i, frame) @@ -378,12 +378,14 @@ function eval_rhs(@nospecialize(recurse), frame, node::Expr) args = let mod=mod Any[@lookup(mod, frame, arg) for arg in node.args] end - T = popfirst!(args) + T = popfirst!(args)::DataType rhs = ccall(:jl_new_structv, Any, (Any, Ptr{Any}, UInt32), T, args, length(args)) return rhs elseif head === :splatnew # Julia 1.2+ mod = moduleof(frame) - rhs = ccall(:jl_new_structt, Any, (Any, Any), @lookup(mod, frame, node.args[1]), @lookup(mod, frame, node.args[2])) + T = @lookup(mod, frame, node.args[1])::DataType + args = @lookup(mod, frame, node.args[2])::Tuple + rhs = ccall(:jl_new_structt, Any, (Any, Any), T, args) return rhs elseif head === :isdefined return check_isdefined(frame, node.args[1]) diff --git a/src/utils.jl b/src/utils.jl index 1c1bfd37..648d4ecc 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -40,14 +40,14 @@ function whichtt(@nospecialize(tt)) match === nothing && return nothing return match.method else - m = ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), tt, get_world_counter()) + m = ccall(:jl_gf_invoke_lookup, Any, (Any, Csize_t), tt, get_world_counter()) m === nothing && return nothing isa(m, Method) && return m return m.func::Method end end -instantiate_type_in_env(arg, spsig, spvals) = +instantiate_type_in_env(arg, spsig::UnionAll, spvals::Vector{Any}) = ccall(:jl_instantiate_type_in_env, Any, (Any, Any, Ptr{Any}), arg, spsig, spvals) function sparam_syms(meth::Method)