tact-lang / tact

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

`return`-reachability analysis should take unconditional `throw` into account #421

Open anton-trunov opened 3 days ago

anton-trunov commented 3 days ago

For instance, something like this should not result in an error message from the analysis:

fun test1(): Int {
  throw(200);
}

or, a bit more realistic example:

fun test2(c: Bool): Int {
  if (c) {
    throw(200);
  } else {
    return 42;
  }
}