"Set Variable" - Shallow/Deep Copy?

EDIT: Kinda embaressed that I didnt know about the difference between value and reference types before. In the original post I used an example using value types (hence the first reply) however the question still stands for reference types I guess?

Not sure if I understand, and I’m too lazy to run it.
At the end B is equals to 1 or 2? As if to 1, then it looks like perfectly valid logic, it would work the same in c# and most of other languages, unless some pointer or wrapped type would be used. As its a number, a simple value type, and value types are passed by value and not reference.