mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Compiler: make calling functions work
This commit is contained in:
parent
851a910e41
commit
4672e54f5e
17 changed files with 500 additions and 40 deletions
|
@ -0,0 +1,26 @@
|
|||
|
||||
|
||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
|
||||
Xxx := Rectangle {
|
||||
function foo(a: int) -> string { return a; }
|
||||
|
||||
function bar() {
|
||||
foo(45, 45);
|
||||
// ^error{The callback or function expects 1 arguments, but 2 are provided}
|
||||
|
||||
foo.hello(45);
|
||||
// ^error{Cannot access fields of a function}
|
||||
|
||||
root.foo();
|
||||
// ^error{The callback or function expects 1 arguments, but 0 are provided}
|
||||
|
||||
root.foo.hello(45);
|
||||
// ^error{Cannot access fields of a function}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue