diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-04-08 12:52:34 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-04-08 23:26:19 +0200 |
commit | d97ff367c292ca8ac65c06fb9699558da7d21bd4 (patch) | |
tree | 18d3d63cb47732dcaf928a535f83e0fe4a40dcfb /tools/qmllint/checkidentifiers.cpp | |
parent | a6cde06936194f5119e1b9bb850f8d4edc8d9e5c (diff) |
qmllint: Initialize special casing for QString on checkMemberAccess()
If the very first component in the member access chain is already a
QString, we need to expect "length" as only valid property from the
beginning. Like we do for lists.
Task-number: QTBUG-92447
Change-Id: I4549f4da52cb1c0968b24813f0a921a129da28ee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.cpp')
-rw-r--r-- | tools/qmllint/checkidentifiers.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp index 911e08034a..208f44e51b 100644 --- a/tools/qmllint/checkidentifiers.cpp +++ b/tools/qmllint/checkidentifiers.cpp @@ -81,6 +81,9 @@ void CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, if (prop != nullptr && prop->isList()) { detectedRestrictiveKind = QLatin1String("list"); expectedNext.append(QLatin1String("length")); + } else if (outerScope->internalName() == QLatin1String("QString")) { + detectedRestrictiveKind = QLatin1String("QString"); + expectedNext.append(QLatin1String("length")); } QQmlJSScope::ConstPtr scope = outerScope; |