It is impossible to compile, and fortunately. Imagine you put an integer in an a or b object in a swap method. This would not be possible at all, because the actual reference refers to a type string object.
You can disable this behavior in a dynamically typed scripting language, such as JavaScript or PHP, because it is just "var" anyway. But in a statically typed language like C #, this is not possible.
source share