qmljs: actually fix incorrect condition

Suppress error message if either the current or the sub import are
optional.

Change-Id: I6ab8592c6aa8b20576bfa897e432d317f8a7e3b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Fawzi Mohamed
2020-11-27 02:13:00 +01:00
parent 6f17ad0562
commit 054e3fa28f

View File

@@ -503,7 +503,7 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
if (!subImportFound && errorLoc.isValid()) {
import->valid = false;
if (toImport.flags & QmlDirParser::Import::Optional)
if (!(optional || (toImport.flags & QmlDirParser::Import::Optional)))
error(doc, errorLoc,
Link::tr(
"Implicit import '%1' of QML module '%2' not found.\n\n"