| 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 | export X := Rectangle { |
| 5 | background: { |
| 6 | return 42; |
| 7 | // ^error{Cannot convert float to brush} |
| 8 | return blue; |
| 9 | } |
| 10 | |
| 11 | callback xxx() -> string; |
| 12 | xxx => { |
| 13 | return 42phx; |
| 14 | // ^error{Cannot convert physical-length to string. Divide by 1phx to convert to a plain number} |
| 15 | } |
| 16 | |
| 17 | |
| 18 | // Issue 3962 |
| 19 | FocusScope { |
| 20 | key-released(event) => { |
| 21 | if (!self.visible) { |
| 22 | return; |
| 23 | // ^error{Must return a value of type 'enum EventResult'} |
| 24 | } |
| 25 | accept |
| 26 | } |
| 27 | |
| 28 | enabled: { |
| 29 | return; |
| 30 | // ^error{Must return a value of type 'bool'} |
| 31 | true; |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |