Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback enters unreachable code when used as alias inside a separate component #7806

Open
abalogstromer opened this issue Mar 5, 2025 · 1 comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working

Comments

@abalogstromer
Copy link

abalogstromer commented Mar 5, 2025

Bug Description

I was trying to workaround this issue (#2268). I thought to wrap the callback in another component to by-pass the duplication issue of the callback. When I wanted to build the code, it failed with the following error:

[build] thread 'main' panicked at internal/compiler/llr/optim_passes/count_property_use.rs:53:22:
[build] internal error: entered unreachable code

The reason for trying this is that I expose an adapter to be used in C++. There I want to invoke the callback from the adapter and then on slint side I want to bind the callback in different components wherever I need to react to it.

Reproducible Code (if applicable)

export global ExternalAdapter {
    callback action();
}


component WrapperCall {
    callback action_call <=> ExternalAdapter.action;
}

export component ExampleComponent {
    WrapperCall {
        action_call => {
            debug("Action called");
        }
    }
}

Environment Details

  • Slint Version: 1.8.0
  • Platform/OS: Linux
  • Programming Language: C++
  • Backend/Renderer: Skia

Product Impact

No response

@abalogstromer abalogstromer added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Mar 5, 2025
@ogoffart ogoffart added a:compiler Slint compiler internal (not the codegen, not the parser) and removed need triaging Issue that the owner of the area still need to triage labels Mar 6, 2025
@ogoffart
Copy link
Member

ogoffart commented Mar 6, 2025

Thanks for the bug report.

I can reproduce it in the master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants