1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// A delegate-shaped argument's own parameter count (a lambda literal, or a
// local function passed as a method group), checked against the
// candidate's delegate parameter shape at that position -- the gate
// `declares_here`'s plain argument-count check (`method_arity_admits`)
// cannot express, because it never looks past the COUNT of arguments into
// what any one of them actually is.
//
// Kept as its own module rather than folded into `members.rs` or inlined at
// the two call sites in `assembly.rs`: the call sites are at their own size
// ceiling or close to it, and this gate reads a fact (`lambda_arg_arity`)
// neither `declares_member` nor `method_arity_admits` needs for anything
// else they do.
use DefIndex;
use delegate_parameters;
use FileContext;
use HashMap;
/// Whether `idx`'s own overloads of `member` admit the ref's recorded
/// delegate-shaped argument facts: for every argument position at which
/// `lambda_arg_arity` names such an argument's own parameter count, at
/// least one overload's parameter at that position must be a delegate
/// whose OWN parameter list (`delegate_parameters`) is exactly that long.
///
/// Fails OPEN only where there is nothing to judge, matching
/// `method_arity_admits`'s own rule for a missing arity entry: no
/// `lambda_arg_arity` at all, or no overload named `member`. At a checked
/// position an overload admits only through a parameter that
/// `delegate_parameters` reads as a delegate of exactly that length, so a
/// parameter it reads no list from -- the zero-parameter `Action` and
/// `Func<TResult>` shapes included -- admits nothing there.
pub