compiler: turn a warning into an error

cc #2024
This commit is contained in:
Olivier Goffart 2023-03-20 16:46:40 +01:00 committed by Olivier Goffart
parent c82bb1515e
commit 47ac396bc0
2 changed files with 7 additions and 7 deletions

View file

@ -1282,7 +1282,7 @@ impl Element {
| SyntaxKind::RepeatedElement
| SyntaxKind::ChildrenPlaceholder
) {
diag.push_warning("A ListView can just have a single 'for' as children. Anything else is not supported".into(), &se)
diag.push_error("A ListView can just have a single 'for' as children. Anything else is not supported".into(), &se)
}
}
}

View file

@ -6,7 +6,7 @@ import { ListView } from "std-widgets.slint";
Foo := Rectangle {
ListView {
@children
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
}
}
@ -14,22 +14,22 @@ export Bar := Rectangle {
Foo { Text {} }
ListView {
Text {}
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
}
ListView {
Text { }
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
for x in 2: Rectangle {}
Text { }
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
for x in 2: Rectangle {}
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
}
ListView { for x in 2: Rectangle {} }
ListView {
for x in 2: Rectangle {}
for x in 2: Rectangle {}
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
// ^error{A ListView can just have a single 'for' as children. Anything else is not supported}
}
}