use read_only::embed;

mod m {
    use super::embed;

    #[embed]
    pub struct Demo {
        #[readonly]
        pub visible: i32,
        pub mutable: i32,
        internal: i32,
    }

    impl Demo {
        pub fn new(v: i32, m: i32, i: i32) -> Self {
            Self {
                read_only: ReadOnlyDemo { visible: v },
                mutable: m,
                internal: i,
            }
        }

        pub fn sum(&self) -> i32 {
            self.visible + self.mutable + self.internal
        }
    }
}

fn main() {
    let mut demo = m::Demo::new(1, 2, 3);
    let _ = demo.visible;
    demo.mutable = 10;
    let _ = demo.mutable;
    let _ = demo.sum();
}
