@@ -937,8 +937,8 @@ function methods(@nospecialize(f), @nospecialize(t),
937
937
world = typemax (UInt)
938
938
# Lack of specialization => a comprehension triggers too many invalidations via _collect, so collect the methods manually
939
939
ms = Method[]
940
- for m in _methods (f, t, - 1 , world)
941
- m:: Core.MethodMatch
940
+ for m in _methods (f, t, - 1 , world):: Vector
941
+ m = m :: Core.MethodMatch
942
942
(mod === nothing || m. method. module ∈ mod) && push! (ms, m. method)
943
943
end
944
944
MethodList (ms, typeof (f). name. mt)
@@ -1186,7 +1186,8 @@ function code_typed_by_type(@nospecialize(tt::Type);
1186
1186
error (" signature does not correspond to a generic function" )
1187
1187
end
1188
1188
asts = []
1189
- for match in matches
1189
+ for match in matches:: Vector
1190
+ match = match:: Core.MethodMatch
1190
1191
meth = func_for_method_checked (match. method, tt, match. sparams)
1191
1192
(code, ty) = Core. Compiler. typeinf_code (interp, meth, match. spec_types, match. sparams, optimize)
1192
1193
code === nothing && error (" inference not successful" ) # inference disabled?
@@ -1218,7 +1219,8 @@ function return_types(@nospecialize(f), @nospecialize(types=Tuple), interp=Core.
1218
1219
types = to_tuple_type (types)
1219
1220
rt = []
1220
1221
world = get_world_counter ()
1221
- for match in _methods (f, types, - 1 , world)
1222
+ for match in _methods (f, types, - 1 , world):: Vector
1223
+ match = match:: Core.MethodMatch
1222
1224
meth = func_for_method_checked (match. method, types, match. sparams)
1223
1225
ty = Core. Compiler. typeinf_type (interp, meth, match. spec_types, match. sparams)
1224
1226
ty === nothing && error (" inference not successful" ) # inference disabled?
@@ -1250,7 +1252,8 @@ function print_statement_costs(io::IO, @nospecialize(tt::Type);
1250
1252
end
1251
1253
params = Core. Compiler. OptimizationParams (interp)
1252
1254
cst = Int[]
1253
- for match in matches
1255
+ for match in matches:: Vector
1256
+ match = match:: Core.MethodMatch
1254
1257
meth = func_for_method_checked (match. method, tt, match. sparams)
1255
1258
(code, ty) = Core. Compiler. typeinf_code (interp, meth, match. spec_types, match. sparams, true )
1256
1259
code === nothing && error (" inference not successful" ) # inference disabled?
@@ -1508,14 +1511,15 @@ function isambiguous(m1::Method, m2::Method; ambiguous_bottom::Bool=false)
1508
1511
ms = _methods_by_ftype (ti, - 1 , typemax (UInt), true , min, max, has_ambig):: Vector
1509
1512
has_ambig[] == 0 && return false
1510
1513
if ! ambiguous_bottom
1511
- filter! (ms) do m
1514
+ filter! (ms) do m:: Core.MethodMatch
1512
1515
return ! has_bottom_parameter (m. spec_types)
1513
1516
end
1514
1517
end
1515
1518
# if ml-matches reported the existence of an ambiguity over their
1516
1519
# intersection, see if both m1 and m2 may be involved in it
1517
1520
have_m1 = have_m2 = false
1518
1521
for match in ms
1522
+ match = match:: Core.MethodMatch
1519
1523
m = match. method
1520
1524
m === m1 && (have_m1 = true )
1521
1525
m === m2 && (have_m2 = true )
0 commit comments