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
#![allow(clippy::used_underscore_binding, clippy::all, warnings, missing_docs)]
#![allow(dead_code)]
#[ allow( unused_imports ) ]
use super::*;
#[ derive( Debug, PartialEq, Default ) ]
pub struct Property<Name> {
name: Name,
code: isize,
}
/// generated by new
impl<Name> Property<Name> {
#[ inline ]
pub fn new<Code>(name: Name, code: Code) -> Self
where
Name: core::convert::Into<Name>,
Code: core::convert::Into<isize>,
{
Self {
name,
code: code.into(),
}
}
}
// TODO: Investigate "cannot find type K in this scope" error
// This appears to be a macro hygiene issue where the type parameter K
// is not properly scoped in the generated code. The error occurs at
// the struct definition line itself, suggesting interference from the
// derive macro expansion.
#[ derive( Debug, PartialEq, the_module::Former ) ]
// #[ debug ] // Commented out - debug attribute only for temporary debugging
pub struct Child<T> where T: core::hash::Hash + core::cmp::Eq {
pub name: String,
// #[ subform_collection( definition = former::HashMapDefinition ) ]
pub properties: collection_tools::HashMap<T, Property<T>>,
}
// == begin_coercing of generated
// == end of generated
// DISABLED: Tests disabled until parametrized struct Former derive is fixed
// include!("./only_test/parametrized_struct.rs");