slint/sixtyfps_compiler/tests/syntax/basic/duplicated_id.60
Simon Hausmann c3ca796b1d Fix missing compiler warning about duplicated ids when using id more than twice
Don't remove the id of a duplicate from the seen set, as it may appear
again.
2021-08-30 20:35:31 +02:00

52 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 */
SubElement := Rectangle {
foo := Rectangle {
background: yellow;
hello := Rectangle {}
// ^warning{duplicated element id 'hello'}
}
unique := Rectangle {
background: yellow;
world := Rectangle {}
// ^warning{duplicated element id 'world'}
}
if (true) : hello := Rectangle {
// ^warning{duplicated element id 'hello'}
world := Rectangle { }
// ^warning{duplicated element id 'world'}
}
hello := Rectangle {}
// ^warning{duplicated element id 'hello'}
}
TestCase := Rectangle {
unique := Rectangle {
foo := SubElement { }
// ^warning{duplicated element id 'foo'}
}
bar := TouchArea {}
// ^warning{duplicated element id 'bar'}
Rectangle {
foo := Text {}
// ^warning{duplicated element id 'foo'}
bar := Text {}
// ^warning{duplicated element id 'bar'}
}
}