use read_only::cast;

mod m {
    use super::cast;

    #[cast]
    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 {
                visible: v,
                mutable: m,
                internal: i,
            }
        }
    }
}

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