use read_only::embed;

mod m {
    use super::embed;

    #[embed]
    pub struct Node {
        #[readonly]
        pub next: Option<Box<Self>>,
        pub value: i32,
    }

    impl Node {
        pub fn new(value: i32) -> Self {
            Self {
                read_only: ReadOnlyNode { next: None },
                value,
            }
        }
    }
}

fn main() {
    let node = m::Node::new(5);
    assert!(node.next.is_none());
    let _ = node.value;
}
