1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4export component Sub {
5 in-out property <int> zoo;
6 private property <int> clou;
7
8 callback clicked;
9 public function hello() {}
10
11 out property <invalid> invalid;
12 // ^error{Unknown type 'invalid'}
13}
14
15export component Test {
16 Sub {
17 changed zoo => { }
18 changed clou => { }
19 // ^error{Change callback on a private property 'clou'}
20 changed zoo => { }
21 // ^error{Duplicated change callback on 'zoo'}
22
23 changed not-exist => {}
24 // ^error{Property 'not-exist' does not exist}
25
26 changed clicked => { }
27 // ^error{Change callback can only be set on properties, and 'clicked' is a callback}
28
29 changed hello => { }
30 // ^error{Change callback can only be set on properties, and 'hello' is a function}
31
32 changed invalid => { }
33 // ^error{Property 'invalid' does not exist}
34
35 property <invalid2> invalid2;
36 // ^error{Unknown type 'invalid2'}
37 changed invalid2 => { }
38 // ^error{Property 'invalid2' does not exist}
39
40 property <Sub> invalid3;
41 // ^error{'Sub' is not a valid type}
42 changed invalid3 => { }
43 // ^error{Property 'invalid3' does not exist}
44
45 }
46
47 property <int> xyz: 42;
48 changed xyz => { }
49}
50