diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-01-16 18:32:24 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-01-17 14:13:55 +0100 |
| commit | 746f38bf56027c29a72bd8a3c3a5f9aad73b9bd3 (patch) | |
| tree | c1f779a136b03784e17a7518c74b22fa511fcbdf /src/qmlcompiler/qqmljslintercodegen.cpp | |
| parent | c159f4e837d99c8cb4b260e7bbc390cdb83d5e19 (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/qqmljslintercodegen.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljslintercodegen.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljslintercodegen.cpp b/src/qmlcompiler/qqmljslintercodegen.cpp index e33fe7139b..0717769a91 100644 --- a/src/qmlcompiler/qqmljslintercodegen.cpp +++ b/src/qmlcompiler/qqmljslintercodegen.cpp @@ -41,8 +41,10 @@ QQmlJSLinterCodegen::compileBinding(const QV4::Compiler::Context *context, const QString name = m_document->stringAt(irBinding.propertyNameIndex); QQmlJSCompilePass::Function function = initializer.run(context, name, astNode, irBinding, &initializationErrors); - for (const auto &error : initializationErrors) - diagnose(error.message, error.type, error.loc); + for (const auto &error : initializationErrors) { + diagnose(u"Could not determine signature of binding for %1: %2"_s.arg(name, error.message), + error.type, error.loc); + } QList<QQmlJS::DiagnosticMessage> analyzeErrors; if (!analyzeFunction(context, &function, &analyzeErrors)) { @@ -70,8 +72,10 @@ QQmlJSLinterCodegen::compileFunction(const QV4::Compiler::Context *context, &m_typeResolver, m_currentObject->location, m_currentScope->location); QQmlJSCompilePass::Function function = initializer.run(context, name, astNode, &initializationErrors); - for (const auto &error : initializationErrors) - diagnose(error.message, error.type, error.loc); + for (const auto &error : initializationErrors) { + diagnose(u"Could not determine signature of function %1: %2"_s.arg(name, error.message), + error.type, error.loc); + } QList<QQmlJS::DiagnosticMessage> analyzeErrors; if (!analyzeFunction(context, &function, &analyzeErrors)) { |
