slint/internal/compiler/tests/syntax/lookup/callback_alias_global.slint
Olivier Goffart 92e5cef55f
Deprecate alias to global callback and error out when setting such callback
Also properly error out when the number of arguments to a callback alias
is not correct

Fixes #7806
2025-03-24 15:17:20 +01:00

18 lines
No EOL
495 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
export global Abc {
callback foobar;
}
component Wrapper {
callback foo <=> Abc.foobar;
// ^warning{Aliases to global callback are deprecated}
}
export component E inherits Window {
Wrapper {
foo => { debug("hello"); }
// ^error{Can't assign a local callback handler to an alias to a global callback}
}
}