use read_only::cast;

mod m {
    use super::cast;

    #[cast]
    pub struct Ordered {
        pub first: i32,
        #[readonly]
        pub second: i32,
        pub third: i32,
        #[readonly]
        pub fourth: i32,
    }

    impl Ordered {
        pub fn new() -> Self {
            Self {
                first: 1,
                second: 2,
                third: 3,
                fourth: 4,
            }
        }
    }
}

fn main() {
    let mut demo = m::Ordered::new();
    demo.first = 10;
    let _ = demo.second;
    demo.third = 30;
    let _ = demo.fourth;
}
