Currently if you add the same message to Status/StatusValue errors/warnings, the message will be recorded twice. There seem to be no use-case for this, so the messages should be deduplicated on insertions.
The error/warning message is considered the same if the message keys are equal and all the parameters are equal. (this is questionable, perhaps we should just compare the keys. Not clear yet, so let's start with comparing parameters as well)
The following logic should apply:
- If there's no errors/warnings with the same message, a new one is added.
- If there is a warning with the same message, and the new message is added as 'fatal', it becomes an error
- Errors can not be downgraded to warnings.
Merge method has to respect the same semantics. Tests should be added for the new behavior.