Refined merging logic #KT-5844 Fixed

If merging primitives of different integral types (e.g. I and Z) return
INT.
Else return UNINITIALIZED_VALUE

This changes were previously commited and discussed within #509 
Forgot it :(
Done