Closed
Description
In the following example the first arm of the if expression doesn't translate:
fn f() -> ! { fail }
fn g() -> int {
auto x = if (true) {
f()
} else {
10
};
ret x;
}
Trans thinks that f() returns int (because x is int) and tries to copy the result of f, which is not int. Replacing f() with a plain fail expression works as expected.