CppEditor: Relax soft assert

The look-up results are ordered by precedence and we can just use the
first one; there doesn't seem to be a reason that additional results
should stop the operation.

Fixes: QTCREATORBUG-14531
Change-Id: Ibe12f975f87ae0d526299219ff54492bef34065c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-07-03 14:33:05 +02:00
parent 00bb6ea958
commit 11a7ccb865

View File

@@ -5989,7 +5989,7 @@ Class *senderOrReceiverClass(const CppQuickFixInterface &interface,
toe.init(interface.semanticInfo().doc, interface.snapshot(), context.bindings());
const QList<LookupItem> objectPointerExpressions = toe(objectPointerExpression,
objectPointerScope, TypeOfExpression::Preprocess);
QTC_ASSERT(objectPointerExpressions.size() == 1, return nullptr);
QTC_ASSERT(!objectPointerExpressions.isEmpty(), return nullptr);
Type *objectPointerTypeBase = objectPointerExpressions.first().type().type();
QTC_ASSERT(objectPointerTypeBase, return nullptr);