slint/sixtyfps_compiler/tests/syntax/basic/duplicated_id.60

45 lines
1.1 KiB
Text

// Copyright © SixtyFPS GmbH <info@sixtyfps.io>
// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
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'}
}
}