antoyo / relm

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
MIT License
2.42k stars 79 forks source link

Bad error message when misusing nested views #265

Open antoyo opened 3 years ago

antoyo commented 3 years ago

The following code:

view! {
    #[name="window"]
    gtk::Window {
        titlebar: &view! {
            handy::HeaderBar {
                show_close_button: true,
                title: Some("handy title"),
            },
        },
    }
}

gives the following error:

error[E0425]: cannot find value `__relm_nested_widget0` in this scope
  --> src/main.rs:47:24
   |
47 |               titlebar: &view! {
   |  ________________________^
48 | |                 handy::HeaderBar {
49 | |                     show_close_button: true,
50 | |                     title: Some("handy title"),
51 | |                 },
52 | |             },
   | |_____________^ not found in this scope