slint/sixtyfps_compiler/tests/syntax/lookup/two_way_binding_infer.60
Olivier Goffart c25538c982 Normalize identifiers to - instead of _
As a result
 - The error messages will now show the error with `-` instead of `_`
 - The LSP will auto-complete with -
 - The interpreter's list of properties will list the property with '-'
   (but we made the change so that set_property, get_property, and so on
   work also if passed a '-')
2021-08-10 22:21:01 +02:00

34 lines
1.4 KiB
Text

/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
X := Rectangle {
property infer_loop <=> infer_loop2;
// ^error{Could not infer type of property 'infer-loop'}
property infer_loop2 <=> infer_loop3;
// ^error{Could not infer type of property 'infer-loop2'}
property infer_loop3 <=> infer_loop;
// ^error{Could not infer type of property 'infer-loop3'}
// ^^error{Unknown unqualified identifier 'infer_loop'}
// ^^^error{The expression in a two way binding must be a property reference}
property infer_error <=> r.infer_error;
// ^error{Could not infer type of property 'infer-error'}
r := Rectangle {
property infer_error <=> 0;
// ^error{The expression in a two way binding must be a property reference}
// ^^error{Could not infer type of property 'infer-error'}
}
property auto_background <=> background;
property <string> alias_to_background <=> auto_background;
// ^error{The property does not have the same type as the bound property}
}