tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
280 stars 56 forks source link

Inconsistent message field assignment for regular and bounced messages #478

Open anton-trunov opened 3 days ago

anton-trunov commented 3 days ago
import "@stdlib/deploy";

message A { a: Int as uint32; b: Int }

contract Test with Deployable {
  receive(src: A) {
    src.a = 42; // <-- this works
  }

  bounced(src: bounced<A>) {
    src.a = 42; // <-- this DOES NOT work
  }
}

When compiling the contract above, it fails with the following error:

main.tact:11:9: Invalid type "bounced" for field access 
Line 11, col 9: 
10 |   bounced(src: bounced) { 
> 11 |     src.a = 42; 
               ^ 
  12 |   }

Either both of those assignments should be allowed or none of them. Provided the accessed field is fully within the size limits of bounced messages.