diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-04-27 09:45:40 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-04-28 14:01:46 +0000 |
commit | 7870b80ff70089937a6e7f03d99bd40e808c0242 (patch) | |
tree | 9e312a1a2b043de994252cf091f2da1564f2a6a8 /src | |
parent | 70189916933cffaa3c2ed767d82f6a7d524a164e (diff) | |
download | qbs-7870b80ff70089937a6e7f03d99bd40e808c0242.tar.gz |
Fix Value copy constructor
We forgot a member, which manifested itself when using module properties
whose value referred to "original" on the group level.
Also fix a check in Evaluator that prevented us from even trying to
evaluate such properties.
Amends fb52fed84a1510a7de0172e643d6fd66a780e2e8.
Change-Id: I73cae5e6d9603f277862a1ccc8ea8f676d6a5ab1
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/language/evaluator.cpp | 3 | ||||
-rw-r--r-- | src/lib/corelib/language/value.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/corelib/language/evaluator.cpp b/src/lib/corelib/language/evaluator.cpp index 3d4c98a79..833ab96f2 100644 --- a/src/lib/corelib/language/evaluator.cpp +++ b/src/lib/corelib/language/evaluator.cpp @@ -570,7 +570,8 @@ private: if (data->item->propertyDeclaration(*propertyName).isScalar()) { const Item *item = itemOfProperty; - if (item->type() != ItemType::ModuleInstance) { + if (item->type() != ItemType::ModuleInstance + && item->type() != ItemType::ModuleInstancePlaceholder) { const QString errorMessage = Tr::tr("The special value 'original' can only " "be used with module properties."); extraScope = throwError(engine->context(), errorMessage); diff --git a/src/lib/corelib/language/value.cpp b/src/lib/corelib/language/value.cpp index 7ba9ff384..fabc64ccd 100644 --- a/src/lib/corelib/language/value.cpp +++ b/src/lib/corelib/language/value.cpp @@ -57,7 +57,9 @@ Value::Value(Type t, bool createdByPropertiesBlock) : m_type(t) Value::Value(const Value &other) : m_type(other.m_type), m_scope(other.m_scope), + m_scopeName(other.m_scopeName), m_next(other.m_next ? other.m_next->clone() : ValuePtr()), + m_candidates(other.m_candidates), m_flags(other.m_flags) { } |