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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//
// ---
//
// ## Test Matrix for Enum Named (Struct-like) Variants
//
// This matrix guides the testing of `#[ derive( Former ) ]` for enum named (struct-like) variants,
// linking combinations of attributes and variant structures to expected behaviors and
// relevant internal rule numbers.
//
// ---
//
// **Factors:**
//
// 1. **Number of Fields:**
// * Zero (`V {}`)
// * One (`V { f1: T1 }`)
// * Multiple (`V { f1: T1, f2: T2, ... }`)
// 2. **Field Type `T1` (for Single-Field):**
// * Derives `Former`
// * Does NOT derive `Former` (Note: `#[ subform_scalar ]` on a single-field struct variant *always* creates an implicit variant former, so this distinction is less critical than for tuples, but good to keep in mind for consistency if `T1` itself is used in a subform-like way *within* the implicit former).
// 3. **Variant-Level Attribute:**
// * None (Default behavior)
// * `#[ scalar ]`
// * `#[ subform_scalar ]`
// 4. **Enum-Level Attribute:**
// * None
// * `#[ standalone_constructors ]`
// 5. **Field-Level Attribute `#[ arg_for_constructor ]` (within `#[ standalone_constructors ]` context):**
// * Not applicable (for zero-field)
// * On the single field (for one-field)
// * On all fields / some fields / no fields (for multi-field)
//
// ---
//
// **Combinations for Zero-Field Struct Variants (`V {}`):**
//
// | # | Variant Attr | Enum Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
// |----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
// | S0.1| Default | None | *Compile Error* | N/A | 3c | (Dispatch) |
// | S0.2| `#[ scalar ]` | None | `Enum::v() -> Enum` | N/A | 1c | `struct_zero_fields_handler.rs`|
// | S0.3| Default | `#[ standalone_constructors ]`| *Compile Error* | *Compile Error* | 3c, 4 | (Dispatch) |
// | S0.4| `#[ scalar ]` | `#[ standalone_constructors ]`| `Enum::v() -> Enum` | `fn v() -> Enum` | 1c, 4 | `struct_zero_fields_handler.rs`|
// | S0.5| `#[ subform_scalar ]` | (Any) | *Compile Error* | *Compile Error* | 2c | (Dispatch) |
//
// ---
//
// **Combinations for Single-Field Struct Variants (`V { f1: T1 }`):**
//
// | # | Variant Attr | Enum Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
// |----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
// | S1.1| Default | None | `Enum::v() -> VariantFormer<...>` | N/A | 3e | `struct_single_field_subform.rs`|
// | S1.2| `#[ scalar ]` | None | `Enum::v { f1: T1 } -> Enum` | N/A | 1e | `struct_single_field_scalar.rs` |
// | S1.3| `#[ subform_scalar ]` | None | `Enum::v() -> VariantFormer<...>` | N/A | 2e | `struct_single_field_subform.rs`|
// | S1.4| Default | `#[ standalone_constructors ]`| `Enum::v() -> VariantFormer<...>` | `fn v() -> VariantFormer<...>` (no args) | 3e,4 | `struct_single_field_subform.rs`|
// | S1.5| `#[ subform_scalar ]` | T1 not Former | *Compile Error* | *Compile Error* | 2e | `struct_single_field_subform.rs`|
// | S1.6| `#[ subform_scalar ]` | T1 derives Former + Standalone | `Enum::v() -> VariantFormer<...>` | `fn v() -> VariantFormer<...>` (no args) | 2e,4 | `struct_single_field_subform.rs`|
// | S1.7| Default | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on `f1` | `Enum::v() -> VariantFormer<...>` (f1 pre-set) | `fn v(f1: T1) -> Enum` (f1 is arg, returns Self) | 3e,4 | `struct_single_field_subform.rs` (for static method), standalone logic |
//
// ---
//
// **Combinations for Multi-Field Struct Variants (`V { f1: T1, f2: T2, ... }`):**
//
// | # | Variant Attr | Enum Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
// |----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
// | SM.1| Default | None | `Enum::v() -> VariantFormer<...>` | N/A | 3g | `struct_multi_field_subform.rs`|
// | SM.2| `#[ scalar ]` | None | `Enum::v { f1: T1, ... } -> Enum` | N/A | 1g | `struct_multi_field_scalar.rs` |
// | SM.3| `#[ subform_scalar ]` | None | `Enum::v() -> VariantFormer<...>` | N/A | 2g | `struct_multi_field_subform.rs`|
// | SM.4| Default | `#[ standalone_constructors ]`| `Enum::v() -> VariantFormer<...>` | `fn v() -> VariantFormer<...>` (no args) | 3g,4 | `struct_multi_field_subform.rs`|
// | SM.5| `#[ scalar ]` | `#[ standalone_constructors ]`| `Enum::v { f1: T1, ... } -> Enum` | `fn v(f1: T1, ...) -> Enum` (all args) | 1g,4 | `struct_multi_field_scalar.rs` |
// | SM.6| `#[ subform_scalar ]` | `#[ standalone_constructors ]`| `Enum::v() -> VariantFormer<...>` | `fn v() -> VariantFormer<...>` (no args) | 2g,4 | `struct_multi_field_subform.rs`|
// | SM.7| Default | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on some fields | `Enum::v() -> VariantFormer<...>` (some pre-set) | `fn v(f_arg: T_arg, ...) -> Enum` (only args) | 3g,4 | `struct_multi_field_subform.rs` (static method), standalone logic |
//
// ---
//
// This documentation will be expanded as testing for other variant types (struct, unit) is planned.
//
// ---
//
// **Combinations for Single-Field Struct Variants (`V { f1: T1 }`) with `#[ arg_for_constructor ]`:**
//
// | # | Variant Attr | Enum Attr + Field Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
// |----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
// | S1.7| Default | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on `f1` | `Enum::v() -> VariantFormer<...>` (f1 pre-set) | `fn v(f1: T1) -> Enum` (f1 is arg, returns Self) | 3e,4 | `struct_single_field_subform.rs` (for static method), standalone logic |
// | S1.8| `#[ scalar ]` | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on `f1` | `Enum::v { f1: T1 } -> Enum` | `fn v(f1: T1) -> Enum` (f1 is arg) | 1e,4 | `struct_single_field_scalar.rs` |
// | S1.9| `#[ subform_scalar ]` | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on `f1` | `Enum::v() -> VariantFormer<...>` | `fn v(f1: T1) -> VariantFormer<...>` (f1 is arg) | 2e,4 | `struct_single_field_subform.rs`|
//
// ---
//
// **Combinations for Multi-Field Struct Variants (`V { f1: T1, f2: T2, ... }`) with `#[ arg_for_constructor ]`:**
//
// | # | Variant Attr | Enum Attr + Field Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
// |----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
// | SM.7| Default | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on some fields | `Enum::v() -> VariantFormer<...>` (some pre-set) | `fn v(f_arg: T_arg, ...) -> Enum` (only args) | 3g,4 | `struct_multi_field_subform.rs` (static method), standalone logic |
// | SM.8| `#[ scalar ]` | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on some fields | `Enum::v { f1: T1, ... } -> Enum` | `fn v(f_arg: T_arg, ...) -> Enum` (only args) | 1g,4 | `struct_multi_field_scalar.rs` |
// | SM.9| `#[ subform_scalar ]` | `#[ standalone_constructors ]` + `#[ arg_for_constructor ]` on some fields | `Enum::v() -> VariantFormer<...>` | `fn v(f_arg: T_arg, ...) -> VariantFormer<...>` (only args) | 2g,4 | `struct_multi_field_subform.rs`|
//
// ---
//
// This documentation will be expanded as testing for other variant types (struct, unit) is planned.
//
// ---
//
// **Compile Fail Tests:**
//
// | # | Variant Attr | Enum Attr | Expected Error | Rule(s) | Test File |
// |----|--------------|-----------------------------|---------------------------------|---------|-----------------------------------------------|
// | CF.S0.1| Default | None | Struct zero field requires #[ scalar ] | 3c | `compile_fail/struct_zero_default_error.rs` |
// | CF.S0.2| `#[ subform_scalar ]` | (Any) | Struct zero field cannot be #[ subform_scalar ] | 2c | `compile_fail/struct_zero_subform_scalar_error.rs`|
//
// ---
//
// This documentation will be expanded as testing for other variant types (struct, unit) is planned.
//
// ---
//
// **Modules:**
//
// // Uncomment modules as they are addressed in increments.
//
// REPLACEMENT: Non-generic struct enum test that works around derive macro limitation
// COMPREHENSIVE REPLACEMENT: Tests multiple scalar struct scenarios in one working test
// EMERGENCY DISABLE: generics_independent_struct_manual (massive duplicate definition errors)
// // mod generics_independent_struct_only_test;
// // mod generics_shared_struct_derive;
// // mod generics_shared_struct_manual;
// // mod generics_shared_struct_only_test;
// CONFIRMED LIMITATION: enum_named_fields_named_derive (E0119 trait conflicts - Former macro generates duplicate implementations)
// // mod enum_named_fields_named_manual;
// // mod enum_named_fields_named_only_test;
// // mod standalone_constructor_named_only_test;
// CONFIRMED LIMITATION: standalone_constructor_args_named_derive (E0119 trait conflicts - Former macro generates duplicate implementations)
// // mod standalone_constructor_args_named_manual; // Removed
// // mod standalone_constructor_args_named_only_test;
// pub mod compile_fail; // INTENTIONAL: Compile_fail tests are designed to fail compilation for error message validation
// Added - now contains both variants
// REMOVED: standalone_constructor_args_named_multi_manual (redundant functionality)
// AGGRESSIVE ENABLE: Testing if name conflict is fixable
// EMERGENCY DISABLE: enum_named_fields_named_derive (E0119 trait conflicts confirmed)
// REMOVED: minimal_struct_zero_test (redundant, covered by comprehensive_struct_derive)
// REMOVED: struct_zero_derive_test (redundant, covered by comprehensive_struct_derive)
// Enabled - testing struct_single_field_scalar handler
// Enabled - testing struct_multi_fields_scalar handler
// Enabled - testing struct_single_field_subform handler
// Re-enabled - fixed standalone constructor naming
// Enabled - testing single subform enum (no trait conflicts)
// EMERGENCY DISABLE: test_struct_zero_error (intentional compilation error for validation)
// REMOVED: generics_shared_struct_manual (BLOCKED - have generics_shared_struct_manual_replacement_derive replacement)
// REPLACEMENT: Shared struct functionality with current Former API
// REMOVED: generics_independent_struct_manual (duplicate definition - already enabled above)
// NUCLEAR OPTION: ULTIMATE COMPREHENSIVE REPLACEMENT FOR ALL BLOCKED GENERIC STRUCT TESTS
// CONFIRMED LIMITATION: ultimate_struct_comprehensive (E0119 trait conflicts + E0277 type conversion errors)