neo_solidity/ir/expressions/member_access/
emit.rs

1fn lower_member_access_expression(
2    expr: &Expression,
3    inner: &Expression,
4    member: &Identifier,
5    ctx: &mut LoweringContext,
6    instructions: &mut Vec<Instruction>,
7) -> bool {
8    // `super.member` in a non-call context (e.g., reading a parent state variable).
9    // The compiler flattens inheritance so base-specific members are not separately addressable.
10    if matches!(inner, Expression::Variable(id) if id.name == "super") {
11        ctx.record_error_with_suggestion(
12            format!(
13                "super.{} is not yet supported; the compiler flattens inheritance and does not preserve base-specific member access",
14                member.name
15            ),
16            "access the member directly by name, or extract shared logic into a named internal function",
17        );
18        instructions.push(Instruction::PushLiteral(LiteralValue::Integer(BigInt::zero())));
19        return false;
20    }
21
22    if let Some(result) = try_lower_native_contract_constant(inner, member, instructions) {
23        return result;
24    }
25
26    if let Some(result) = try_lower_selector_member_access(inner, member, ctx, instructions) {
27        return result;
28    }
29
30    if let Some(result) = try_lower_runtime_member_access(inner, member, ctx, instructions) {
31        return result;
32    }
33
34    if let Some(result) = try_lower_address_balance(inner, member, ctx, instructions) {
35        return result;
36    }
37
38    if let Some(result) = try_lower_length_property(inner, member, ctx, instructions) {
39        return result;
40    }
41
42    if let Some(result) = try_lower_current_key(inner, member, ctx, instructions) {
43        return result;
44    }
45
46    if let Some(result) = try_lower_current_value(inner, member, ctx, instructions) {
47        return result;
48    }
49
50    if let Some(result) = try_lower_code_property(inner, member, ctx, instructions) {
51        return result;
52    }
53
54    if let Some(result) = try_lower_type_bound_max(inner, member, ctx, instructions) {
55        return result;
56    }
57
58    if let Some(result) = try_lower_type_bound_min(inner, member, ctx, instructions) {
59        return result;
60    }
61
62    if let Some(result) = try_lower_interface_id(inner, member, ctx, instructions) {
63        return result;
64    }
65
66    if let Some(result) = try_lower_type_name(inner, member, ctx, instructions) {
67        return result;
68    }
69
70    lower_generic_member_access(expr, inner, member, ctx, instructions)
71}