aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2024-02-14 17:34:58 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-01 12:28:58 +0000
commit2dfd04c529d80bd4c5a701fcadfbb0dc2050ba2f (patch)
tree108b4be31d9af0ce7e90cb4099abe5dd9d78a842 /tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml
parent8e6e019cc496e17055942e69913cdc87a8e3c3dd (diff)
qmltc/importvisitor: warn about type annotations on methods
Warn when the types in method type annotations can't be resolved. This hinders qmltc from crashing when trying to compile a QML file with an invalid type annotation like `Qt.point`. To avoid copying and replacing lists, add helpers like mutableOwnMethodsRange() or mutableParametersRange() to obtain mutable iterators to the ownMethods of QQmlJSScope or the parameters of QQmlJSMetaMethod. Fixes: QTBUG-122251 Change-Id: Iffc6ff712fbeaa2fe8b83f94b0bc5a8c278d186c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4aa1deee1be966a6491ab5a1c1de09707a5e8215) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a992badd6fe93812bbee206cc16f62f98ecc0f8c)
Diffstat (limited to 'tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml')
-rw-r--r--tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml b/tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml
new file mode 100644
index 0000000000..fb8c8eb198
--- /dev/null
+++ b/tests/auto/qml/qmltc_qprocess/data/invalidTypeAnnotation.qml
@@ -0,0 +1,20 @@
+import QtQuick
+
+
+Item {
+ function f(): Qt.point {
+
+ }
+
+ function g() {
+
+ }
+
+ function h(a: int, b: Item) {
+
+ }
+
+ function alpha(a: int, b) {}
+ function beta(a: int, b): Item {}
+ function gamma(a: Qt.point, b) {}
+}