use read_only::cast;

mod m {
    use super::cast;

    #[cast]
    pub struct Many {
        #[readonly]
        pub a: i32,
        #[readonly]
        pub b: f64,
        pub c: bool,
        #[readonly]
        pub d: String,
        pub e: char,
        f: u8,
        #[readonly]
        pub g: i16,
    }

    impl Many {
        pub fn new() -> Self {
            Self {
                a: 1,
                b: 2.0,
                c: true,
                d: String::from("hello"),
                e: 'x',
                f: 0,
                g: 42,
            }
        }
    }
}

fn main() {
    let mut demo = m::Many::new();
    let _ = demo.a + demo.b as i32;
    demo.c = false;
    let _ = &demo.d;
    let _ = demo.e;
    let _ = demo.g;
}
