temperlang / temper

3 stars 0 forks source link

Fail vars and blocks without effect #155

Open tjpalmer opened 3 months ago

tjpalmer commented 3 months ago

For the casts/as-expr funtest using bubble values rather than exceptions, I'm getting tmpl like this:

@fail var fail#31: Boolean;
...
@fail module init {
  fail#31 = false;
}
@FQName("work.x=") module init {
  x__24 = t#90;
}
module init {
  if (fail#31) {
    abortLoad;
  }
...

Nothing can ever set fail#31 to true, so it doesn't really do anything. I can write logic to exclude these things in the RustTranslator, but I suspect we shouldn't be generating them in the first place. I haven't yet dug into what's causing these.

tjpalmer commented 3 months ago

And so far, Rust is the only real backend using bubble values, so it's the only one that sees fail vars, and it entirely avoids using them.