mirror of
https://github.com/slint-ui/slint.git
synced 2025-07-16 09:35:21 +00:00

Do the purity check before doing the transformation of the `focus()` function, so the source location of the error is the most accurate Fixes #6979
16 lines
430 B
Text
16 lines
430 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 SubElement {
|
|
forward_focus: input;
|
|
input := TextInput { }
|
|
}
|
|
|
|
export component TestCase {
|
|
pure callback focus_input2();
|
|
focus_input2 => {
|
|
input2.focus();
|
|
// ^error{Call of impure function}
|
|
}
|
|
input2 := SubElement { }
|
|
}
|