PropertySet::setValue() with a bool value resolves unexpected overload

Ouch! Be careful!

If you call PropertySet::setValue() with false then the overload that takes an XmlElement* gets resolved instead of the one with the var. Of course this is correct but difficult to spot until everything breaks!

/** Sets a named property.

@param keyName      the name of the property to set. (This mustn't be an empty string)
@param value        the new value to set it to
*/
void setValue (const String& keyName, const var& value);

/** Sets a named property to an XML element.

@param keyName      the name of the property to set. (This mustn't be an empty string)
@param xml          the new element to set it to. If this is a nullptr, the value will
                    be set to an empty string
@see getXmlValue
*/
void setValue (const String& keyName, const XmlElement* xml);

Actually it’s more subtle. I’ll have to do some more tests …

So the above appears to be the case on Windows but not Mac at least. I did this little godbolt thing to compare compilers:

And in this specific case:

PropertySet set;
set.setValue ("a", nullptr);  // mac: XmlElement - win: XmlElement
set.setValue ("b", 0);        // mac: XmlElement - win: XmlElement
set.setValue ("c", false);    // mac: var (bool) - win: XmlElement
set.setValue ("d", 1);        // mac: var (int)  - win: var (int)
set.setValue ("e", true);     // mac: var (bool) - win: var (bool)

Of course this should only affect literals