Skip to content

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

Closed
@abalogstromer

Description

@abalogstromer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:compilerSlint compiler internal (not the codegen, not the parser)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions