diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-02-03 14:58:26 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-02-14 13:32:13 +0100 |
| commit | aa49d0f2d90ccef3cb2359e107fa30f6819cf434 (patch) | |
| tree | 7e98bc14fb14a4bd6980d2aafa3f0269069d0c69 /src/qmlcompiler/qqmljslintercodegen.cpp | |
| parent | 66893cd719ba862798a12dda5b5e48ba7e2fb0de (diff) | |
qmllint: Fix attached property re-use detection
Move the detection into the QtQuick lint plugin. It's mostly meant for
QQC, so let's auto-enable it for attached types derived from
QQuickAttachedPropertyPropagator.
To this end, two new categories are introduced: The Quick lint plugin
gets its own attached-property-reuse category which is synonymous to the
default category of the same name. Furthermore, we add a
controls-attached-property-reuse category for only checking controls.
That one is implied by either of the others.
Finally, fix the id vs. scope resolution to actually do something.
This way we can give appropriate hints when the outer type has an ID
already.
Pick-to: 6.5
Fixes: QTBUG-110834
Change-Id: Ib71a9e3bbc10bac77f36db6cc441af88df20fd33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljslintercodegen.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljslintercodegen.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljslintercodegen.cpp b/src/qmlcompiler/qqmljslintercodegen.cpp index c7cd5d0d00..f22059fc39 100644 --- a/src/qmlcompiler/qqmljslintercodegen.cpp +++ b/src/qmlcompiler/qqmljslintercodegen.cpp @@ -16,9 +16,8 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; QQmlJSLinterCodegen::QQmlJSLinterCodegen(QQmlJSImporter *importer, const QString &fileName, - const QStringList &qmldirFiles, QQmlJSLogger *logger, - QQmlJSTypeInfo *typeInfo) - : QQmlJSAotCompiler(importer, fileName, qmldirFiles, logger), m_typeInfo(typeInfo) + const QStringList &qmldirFiles, QQmlJSLogger *logger) + : QQmlJSAotCompiler(importer, fileName, qmldirFiles, logger) { } @@ -84,7 +83,7 @@ bool QQmlJSLinterCodegen::analyzeFunction(const QV4::Compiler::Context *context, QQmlJSCompilePass::Function *function, QQmlJS::DiagnosticMessage *error) { - QQmlJSTypePropagator propagator(m_unitGenerator, &m_typeResolver, m_logger, m_typeInfo, + QQmlJSTypePropagator propagator(m_unitGenerator, &m_typeResolver, m_logger, m_passManager); QQmlJSCompilePass::InstructionAnnotations annotations = propagator.run(function, error); if (!error->isValid()) { |
