zng/tests/macro-tests/cases/widget_new/not_allowed_in_when1.rs

26 lines
418 B
Rust

use zng::{
layout::margin,
prelude_wgt::{property, UiNode},
widget::Wgt,
APP,
};
#[property(CONTEXT)]
pub fn foo(child: impl UiNode, value: impl UiNode) -> impl UiNode {
let _ = value;
child
}
fn main() {
let _scope = APP.minimal();
let _ = Wgt! {
margin = 0;
when {
let node = #foo;
true
} {
margin = 1;
}
};
}