aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-10 15:13:13 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-22 17:21:22 +0000
commit2a8fe8d59c80b0f3d0dfea9fb2b8526505d03e24 (patch)
tree80a4021f6a4b9264d7536b7091479470ee1dee34 /tests/auto/qml/qqmllanguage/data
parent1b4d2741f90d3f4daf79940b9c8713dda0fb7f3d (diff)
QML: Don't accept assignment of Component to properties of other types
This is dangerous and I don't see a reason why we should allow it. Fixes: QTBUG-72930 Change-Id: I01b9e624b4b80d52c1a847fa6ecd7a6d44614010 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data')
-rw-r--r--tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.qml9
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.errors.txt b/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.errors.txt
new file mode 100644
index 0000000000..af103cf8bf
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.errors.txt
@@ -0,0 +1 @@
+4:27:Cannot assign object of type "Component" to property of type "QQmlTimer*" as the former is neither the same as the latter nor a sub-class of it.
diff --git a/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.qml b/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.qml
new file mode 100644
index 0000000000..2159bf8116
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/assignComponentToWrongType.qml
@@ -0,0 +1,9 @@
+import QtQml 2.9
+
+QtObject {
+ property Timer stuff: Component {
+ QtObject {
+ objectName: "wrong"
+ }
+ }
+}