use read_only::cast;

mod m {
    use super::cast;

    #[cast]
    pub struct Demo {
        #[readonly]
        pub visible: i32,
        hidden: i32,
    }

    impl Demo {
        pub fn new() -> Self {
            Self { visible: 1, hidden: 2 }
        }

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

fn main() {
    let demo = m::Demo::new();
    let _ = demo.visible;
    let _ = demo.sum();
}
