17196, "mppf", "problem with split-init and ref vs. value tuples", "2021-02-19T16:59:30Z"
Sometimes, split init does not work when the RHS is a ref tuple in one case and a value tuple in another case. For example, the below program fails to compile with an error about split initialization using multiple types:
record R {
var x: int;
}
proc returnTupleTwoRs() {
return (new R(3), new R(4));
}
config const something = true;
proc acceptTwoRs(arg) {
var x;
if something {
x = returnTupleTwoRs();
} else {
x = arg;
}
}
proc main() {
acceptTwoRs( (new R(1), new R(2)) );
}