From 6f904ec4e8fd8596840038341f408569c7813f0d Mon Sep 17 00:00:00 2001 From: Richard Weickelt Date: Sun, 29 Mar 2020 16:48:34 +0200 Subject: Exclude VariantValues when checking for conflicts Qbs prints a warning when different modules contain conflicting assignments to scalar properties. This check assumed that the source values were always of type JSSourceValue and thus performed a invalid static cast which caused sporadic crashes on macOS in TestLanguage::moduleMergingVariantValues. No crashes were obtained on other platforms, but that was only a coincidence. This patch amends 8ff1dd00. Change-Id: Id4809496a5fbc4985d040118a4684f3ac040cdc0 Reviewed-by: Christian Kandeler --- src/lib/corelib/language/modulemerger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp index 5a5bd3ac0..c5deaae04 100644 --- a/src/lib/corelib/language/modulemerger.cpp +++ b/src/lib/corelib/language/modulemerger.cpp @@ -173,7 +173,9 @@ void ModuleMerger::mergeModule(Item::PropertyMap *dstProps, const Item::Module & if (dstVal) { if (srcDecl.isScalar()) { // Scalar properties get replaced. - if (dstVal->type() == Value::JSSourceValueType) { + if ((dstVal->type() == Value::JSSourceValueType) + && (srcVal->type() == Value::JSSourceValueType)) { + // Warn only about conflicting source code values const JSSourceValuePtr dstJsVal = std::static_pointer_cast(dstVal); const JSSourceValuePtr srcJsVal = -- cgit v1.2.3