You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using the latest released (or pre-released, a.k.a. "next") version?
I'm using the latest Tact version
Tact source code
extends mutates fun changeMe(self: Int) {
self = 10;
}
contract Test {
a: Int = 5;
get fun changeFieldDirectly(): Int {
self.a = 10;
return self.a;
}
get fun changeFieldByCopyingContract(): Int {
let contract_copy = self;
contract_copy.a = 10;
self = contract_copy;
return self.a;
}
get fun changeFieldByMutatingFun(): Int {
self.a.changeMe();
return self.a;
}
}
Relevant Tact/build system log output
No response
What happened?
In the above code, no error is reported, even though field self.a is being changed in three different ways in getter functions.
What did you expect?
An error stating that self.a or self cannot be assigned in getter functions. The semantics of getter functions state that they cannot change the contract state.
Steps to reproduce
No response
How do you run Tact?
Tact CLI
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Are you using the latest released (or pre-released, a.k.a. "next") version?
Tact source code
Relevant Tact/build system log output
No response
What happened?
In the above code, no error is reported, even though field
self.a
is being changed in three different ways in getter functions.What did you expect?
An error stating that
self.a
orself
cannot be assigned in getter functions. The semantics of getter functions state that they cannot change the contract state.Steps to reproduce
No response
How do you run Tact?
Tact CLI
Anything else?
No response
The text was updated successfully, but these errors were encountered: