Skip to content

Compiler panic when having an animation on a property alias to a global #9961

@ogoffart

Description

@ogoffart

Bug Description

The code bellow crashes the Slint compiler while generating the LLR:

thread 'main' panicked at internal/compiler/llr/lower_to_item_tree.rs:859:9:
  assertion failed: binding.borrow().animation.is_none()

The interpreter works fine, although it is questionable that several animation could exist on a global. If one add an extra animation like so, it is undefined which one is used.

    property <int> animated2 <=> G.animated;
    animate animated2 { duration: 3s; }

Reproducible Code (if applicable)

import { Button } from "std-widgets.slint";

global G {
    in-out property <int> animated: 8;
}

export component MainWindow inherits Window {
    property <int> animated <=> G.animated;
    animate animated { duration: 300ms; }
    Button {
        text: "Press me! " + G.animated;
        clicked => {
            G.animated += 100;
        }
    }
}

Environment Details

  • Slint Version: 1.15 (master / 8a43b39)

Product Impact

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions