The scope of num2 is only after guard, but it returns when it goes to else. What is the meaning of changing the value of num2 at this time? I assume you want to change the value of oNum? In this case, you can change let oNum to var oNum in guard, but the same thing is meaningless. It may also make sense if the value you want to change is the value of an inout type parameter passed in during an external call.
The scope of num2 is only after guard, but it returns when it goes to else. What is the meaning of changing the value of num2 at this time? I assume you want to change the value of oNum? In this case, you can change let oNum to var oNum in guard, but the same thing is meaningless. It may also make sense if the value you want to change is the value of an inout type parameter passed in during an external call.
This requirement is very strange, it is better to use the ?? operator