aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-01-16 18:32:24 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-01-17 14:13:55 +0100
commit746f38bf56027c29a72bd8a3c3a5f9aad73b9bd3 (patch)
treec1f779a136b03784e17a7518c74b22fa511fcbdf /src/qmlcompiler/qqmljscompiler.cpp
parentc159f4e837d99c8cb4b260e7bbc390cdb83d5e19 (diff)
QmlCompiler: Reduce duplication of warnings about missing properties
If a property cannot be found, we don't need to check its type or even try to compile a binding for it. We also shouldn't claim a property doesn't exist if we cannot find it. We may have failed to resolve the type after all. Pick-to: 6.9 6.8 Task-number: QTBUG-124913 Change-Id: I93ef12e888762ae03f8fa6b1bef2e8d04ba3d4b2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 8143f588ae..30c869c439 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -674,8 +674,13 @@ std::variant<QQmlJSAotFunction, QList<QQmlJS::DiagnosticMessage>> QQmlJSAotCompi
const QString name = m_document->stringAt(irBinding.propertyNameIndex);
QQmlJSCompilePass::Function function = initializer.run(
context, name, astNode, irBinding, &errors);
- const QQmlJSAotFunction aotFunction = doCompileAndRecordAotStats(
- context, &function, &errors, name, astNode->firstSourceLocation());
+
+ QQmlJSAotFunction aotFunction;
+ if (errors.isEmpty()) {
+ aotFunction = doCompileAndRecordAotStats(
+ context, &function, &errors, name, astNode->firstSourceLocation());
+ }
+
if (!errors.isEmpty()) {
for (auto &error : errors) {