Nobu said that we should show warning for such duplication (especially for 1st and 3rd cases) because we can detect duplication while parsing/compiling.
parse.y (assocs): concatenate splatted literal hashes. the
former key has precedence even if duplicated literal keys
follow. [ruby-core:65368] [Bug #10315]
parse.y (assocs): concatenate splatted literal hashes. the
former key has precedence even if duplicated literal keys
follow. [ruby-core:65368] [Bug #10315]
There is a problem with this solution. Namely, duplicate key-value pairs are removed at parsing stage, and if they had side effects (like printing), the semantics changes.