| 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 component Test { |
| 5 | property <int> abc; |
| 6 | abc := Rectangle { |
| 7 | property <float> cde; |
| 8 | Rectangle { |
| 9 | property <float> abc; |
| 10 | cde := Rectangle { |
| 11 | y: cde * 1px |
| 12 | // ^error{Cannot take reference of an element. Use 'abc.cde' to access the property with the same name} |
| 13 | + abc * 1px; |
| 14 | // ^error{Cannot take reference of an element. Use 'parent.abc' to access the property with the same name} |
| 15 | Rectangle { |
| 16 | width: abc * 1px; // this would try to access the abc property of the un-named element, so no hint |
| 17 | // ^error{Cannot take reference of an element$} |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | x: cde * 1px |
| 22 | // ^error{Cannot take reference of an element. Use 'abc.cde' to access the property with the same name} |
| 23 | + abc * 1px; |
| 24 | // ^error{Cannot take reference of an element. Use 'self.abc' to access the property with the same name} |
| 25 | } |
| 26 | password := TextInput { |
| 27 | x: cde * 1px |
| 28 | // ^error{Cannot take reference of an element. Use 'abc.cde' to access the property with the same name} |
| 29 | + abc * 1px; |
| 30 | // ^error{Cannot take reference of an element. Use 'root.abc' to access the property with the same name} |
| 31 | input-type: password; |
| 32 | // ^error{Cannot take reference of an element. Use 'InputType.password' to access the enumeration value} |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | |