slint icon indicating copy to clipboard operation
slint copied to clipboard

Error should be produced for callback with multiple aliases

Open ogoffart opened this issue 2 years ago • 1 comments
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

SlintPad

This should produce an error.

Also happens with Globals.

ogoffart avatar Nov 20 '23 12:11 ogoffart

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

tronical avatar May 21 '24 15:05 tronical