diff options
author | Christian Stenger <christian.stenger@qt.io> | 2021-05-06 08:54:36 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2021-05-06 09:31:12 +0000 |
commit | fd64253a62929fa6db6f865dc9a9e30098eb7524 (patch) | |
tree | fc57c08a4b7ea657070352e21a1a7b4b033e4c82 /src/libs/qmljs/qmljscheck.cpp | |
parent | 11dcdb74ef8654d9b14ef76ad9537799be04b318 (diff) | |
download | qt-creator-fd64253a62929fa6db6f865dc9a9e30098eb7524.tar.gz |
QmlJS: Suppress wrong warning
When a type is created inside a file with the same name
do not warn if the created type is namespaced.
Fixes: QTCREATORBUG-24615
Change-Id: Icb2b1a9fd1a02ee222084b676ee818eed65a7c93
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r-- | src/libs/qmljs/qmljscheck.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 4d084692e4..344b39d14e 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -939,13 +939,13 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, if (checkTypeForDesignerSupport(typeId)) addMessage(WarnUnsupportedTypeInVisualDesigner, typeErrorLocation, typeName); - if (QFileInfo(_doc->fileName()).baseName() == getRightMostIdentifier(typeId)->name.toString()) + if (typeId->next == nullptr && QFileInfo(_doc->fileName()).baseName() == typeName) addMessage(ErrTypeIsInstantiatedRecursively, typeErrorLocation, typeName); if (checkTypeForQmlUiSupport(typeId)) addMessage(ErrUnsupportedTypeInQmlUi, typeErrorLocation, typeName); - if (m_typeStack.count() > 1 && getRightMostIdentifier(typeId)->name.toString() == "State") { + if (m_typeStack.count() > 1 && typeName == "State") { addMessage(WarnStatesOnlyInRootItemForVisualDesigner, typeErrorLocation); addMessage(ErrStatesOnlyInRootItemInQmlUi, typeErrorLocation); } |