Huh, this is strange. I had an intuition that structs can be mutated if they are captured as inout argument. Is int not mutable because it is a special case or something?
Admin note: please put something descriptive in the title. "Uhmm, what?" gives no indication what the post is about. The forums are very active and it's polite to help participants decide which topics to read and which to skip.
Int(8) is just a value. It doesn't declare any storage. For there to be mutation, you must create storage to mutate, using var. It is the value in that storage that can be mutated when you pass it inout.
You might say, well, why doesn't the compiler implicitly create storage for me, since that's obviously what's needed to make this compile. But that would allow callers to accidentally discard a mutated value without realizing it. Presumably the argument is inout for a reason โ the mutation it performs on the argument is meaningful. So you can think of the compiler not doing this as similar to it requiring you acknowledge a return value of a function even if you aren't interested in it e.g. with _ = f().