From 3035733415225ef3bb93f52f0840f27cb10fbc2e Mon Sep 17 00:00:00 2001 From: Christian Kamm <christian.d.kamm@nokia.com> Date: Wed, 17 Feb 2010 09:29:13 +0100 Subject: [PATCH] Workaround for not erroring on anchors { ... } in Qml for now. --- src/libs/qmljs/qmljscheck.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 1ae028c8152..e128148d15c 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -86,8 +86,17 @@ bool Check::visit(UiObjectBinding *ast) void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, UiObjectInitializer *initializer) { + // If the 'typeId' starts with a lower-case letter, it doesn't define + // a new object instance. For instance: anchors { ... } + if (typeId->name->asString().at(0).isLower() && ! typeId->next) { + checkScopeObjectMember(typeId); + // ### don't give up! + return; + } + if (! _context.lookupType(_doc.data(), typeId)) { warning(typeId->identifierToken, QLatin1String("unknown type")); + // ### don't give up! return; } -- GitLab