slint
slint copied to clipboard
Error should be produced for callback with multiple aliases
trafficstars
Discussed in https://github.com/slint-ui/slint/discussions/3947#discussioncomment-7597955
export component Foo {
callback clickedA <=> button.clicked;
callback clickedB <=> button.clicked;
button := Button {
text: "OK!";
}
}
Multiple callback to the same callback won't work and only one will be run
This should produce an error.
Also happens with Globals.
Similarly, this causes a panic in the compiler:
global Glob {
callback global-callback();
}
component Foo {
callback cb <=> Glob.global-callback;
}
export component Demo {
Foo {
cb => {
debug("ok");
}
}
TouchArea {
clicked => {
Glob.global-callback();
}
}
}
thread 'main' panicked at internal/compiler/llr/optim_passes/count_property_use.rs:55:22:
internal error: entered unreachable code