| 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 | global Plop := { |
| 5 | property <int> x: max; |
| 6 | // ^error{Builtin function must be called} |
| 7 | } |
| 8 | |
| 9 | export SuperSimple := Rectangle { |
| 10 | property <int> a: max + max() + max(45, "hello" ); |
| 11 | // ^error{Builtin function must be called} |
| 12 | // ^^error{Needs at least one argument} |
| 13 | // ^^^error{Invalid argument type} |
| 14 | property <length> b: max(41px, 41phx); |
| 15 | property <string> c: max("a" , "b" ); |
| 16 | // ^error{Invalid argument type} |
| 17 | |
| 18 | property <int> d: min + min() + min(45, "hello" ); |
| 19 | // ^error{Builtin function must be called} |
| 20 | // ^^error{Needs at least one argument} |
| 21 | // ^^^error{Invalid argument type} |
| 22 | property <length> e: min(41px, 41phx); |
| 23 | property <string> f: min("a" , "b" ); |
| 24 | // ^error{Invalid argument type} |
| 25 | |
| 26 | property <int> g: min(42, 42, 42cm); |
| 27 | // ^error{Cannot convert float to length} |
| 28 | // ^^error{Cannot convert float to length} |
| 29 | property <int> h: min(42, 42 + 1) + max(1px , 2phx); |
| 30 | // ^error{Cannot convert float to length} |
| 31 | |
| 32 | |
| 33 | } |
| 34 | |