aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-18 16:47:34 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-05-26 11:35:46 +0200
commitcf82561a75ebef9d20bed21dfc3f050611a08e7f (patch)
tree743700c177ddd7117bdb132b03d3887f1e0c0a62 /tests
parent1e03675dd95129702751b40ec80a999ffab7394e (diff)
qmllint: Fix evaluation of type assertions
Previously, type assertions were ignored. The test case didn't fail because simple type casts were automatically detected when the derived objects were instantiated and assigned to base type properties. Change-Id: I437e77ff38b7d570451cf27ca84e9897b519413f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ac9ab322d00ad8a2139bcf463275e3121bfb1f)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmllint/data/goodTypeAssertion.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/qml/qmllint/data/goodTypeAssertion.qml b/tests/auto/qml/qmllint/data/goodTypeAssertion.qml
index 6f5f52eb6b..85aaf50d06 100644
--- a/tests/auto/qml/qmllint/data/goodTypeAssertion.qml
+++ b/tests/auto/qml/qmllint/data/goodTypeAssertion.qml
@@ -1,6 +1,9 @@
import QtQuick 2.0
Item {
- property QtObject foo: Item { x: 4 }
+ id: root
+ function self() { return root }
+
+ property QtObject foo: self()
property real foox: (foo as Item).x
}