@@ -15,6 +15,7 @@ struct InferenceParams
15
15
inlining:: Bool
16
16
17
17
# parameters limiting potentially-infinite types (configurable)
18
+ MAX_METHODS:: Int
18
19
MAX_TUPLETYPE_LEN:: Int
19
20
MAX_TUPLE_DEPTH:: Int
20
21
MAX_TUPLE_SPLAT:: Int
@@ -24,12 +25,13 @@ struct InferenceParams
24
25
# reasonable defaults
25
26
function InferenceParams (world:: UInt ;
26
27
inlining:: Bool = inlining_enabled (),
28
+ max_methods:: Int = 4 ,
27
29
tupletype_len:: Int = 15 ,
28
30
tuple_depth:: Int = 4 ,
29
31
tuple_splat:: Int = 16 ,
30
32
union_splitting:: Int = 4 ,
31
33
apply_union_enum:: Int = 8 )
32
- return new (world, inlining, tupletype_len,
34
+ return new (world, inlining, max_methods, tupletype_len,
33
35
tuple_depth, tuple_splat, union_splitting, apply_union_enum)
34
36
end
35
37
end
@@ -1280,7 +1282,7 @@ function abstract_call_gf_by_type(f::ANY, atype::ANY, sv::InferenceState)
1280
1282
end
1281
1283
min_valid = UInt[typemin (UInt)]
1282
1284
max_valid = UInt[typemax (UInt)]
1283
- applicable = _methods_by_ftype (argtype, 4 , sv. params. world, min_valid, max_valid)
1285
+ applicable = _methods_by_ftype (argtype, sv . params . MAX_METHODS , sv. params. world, min_valid, max_valid)
1284
1286
rettype = Bottom
1285
1287
if applicable === false
1286
1288
# this means too many methods matched
0 commit comments