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
4
5export component Foo {
6 property <float> m1: mod(4);
7 // ^error{Needs 2 arguments}
8
9 property <float> m2: mod(4, 5, 5);
10 // ^error{Needs 2 arguments}
11
12 property <float> m3: mod("455", "465");
13 // ^error{Cannot convert string to float}
14 // ^^error{Cannot convert string to float}
15
16 property <float> m4: mod(455, "465");
17 // ^error{Cannot convert string to float}
18
19 property <length> m5: mod(45px, 4);
20 // ^error{Cannot convert float to length}
21
22 property <length> m6: mod(45px, 4ms);
23 // ^error{Cannot convert duration to length}
24
25 property <duration> m7: mod(5, 4ms);
26 // ^error{Cannot convert float to duration}
27
28 property <duration> m8: (5).mod(4ms);
29 // ^error{Cannot convert float to duration}
30
31 property <duration> m9: 5ms.mod(4);
32 // ^error{Cannot convert float to duration}
33
34 property <float> a1: abs();
35 // ^error{Needs 1 argument}
36
37 property <float> a2: abs(4, 5, 5);
38 // ^error{Needs 1 argument}
39
40 property <float> a3: abs(1, 2);
41 // ^error{Needs 1 argument}
42
43 property <float> a4: abs("465");
44 // ^error{Cannot convert string to float}
45
46 property <string> a5: abs(45px);
47 // ^error{Cannot convert length to string}
48
49 property <string> a6: abs;
50 // ^error{Builtin function must be called}
51
52 property <string> a7: (-21).abs;
53 // ^error{Member function must be called}
54
55
56 property <float> sq1: 1.0.sqrt(1);
57 // ^error{The callback or function expects 0 arguments, but 1 are provided}
58
59 property <float> sq2: 1.0.sqrt;
60 // ^error{Member function must be called}
61}