slint/internal/compiler/tests/syntax/elements/path.slint
Simon Hausmann 74db0a39f2
Fix regression in the Path element when used with inheritance (#9176)
After commit ef2e6491cd we end up processing Paths multiple times, and thus we might end up attempting to replace an elements binding. Don't do that if no new elements are declared, but yield an error if attempting to do so. We could support this in the future (appending), but for now it's better to produce an error.

Fixes #9170
2025-08-17 16:54:18 +02:00

20 lines
476 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
component Arc inherits Path {
MoveTo {
x: 0;
y: 0;
}
}
export component Foo inherits Rectangle {
Arc { } // OK!
Arc {
// ^error{The Path was already populated in the base type and it can't be re-populated again}
LineTo {
x: 1;
y: 1;
}
}
}