don't throw away a jump

This commit is contained in:
Folkert 2022-01-03 16:50:43 +01:00
parent 7044e95df8
commit fc4cea9f75
2 changed files with 11 additions and 4 deletions

View File

@ -2909,8 +2909,13 @@ fn specialize_naked_symbol<'a>(
std::vec::Vec::new(),
layout_cache,
assigned,
env.arena.alloc(Stmt::Ret(assigned)),
env.arena.alloc(match hole {
Stmt::Jump(id, _) => Stmt::Jump(*id, env.arena.alloc([assigned])),
Stmt::Ret(_) => Stmt::Ret(assigned),
_ => unreachable!(),
}),
);
return result;
}
}

View File

@ -4,8 +4,10 @@ app "issue2279"
provides [ main ] to pf
main =
t1 = Issue2279Help.asText 42
t2 = Issue2279Help.text
text = if True then t1 else t2
text =
if True then
Issue2279Help.text
else
Issue2279Help.asText 42
Task.putLine text