mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
consistently name function symbols
previously the dev backend did not take into account lambda name information to generate function names. This could cause the same function name to be defined twice
This commit is contained in:
parent
58c6c664fd
commit
59da1ea891
4 changed files with 225 additions and 9 deletions
|
@ -335,15 +335,15 @@ trait Backend<'a> {
|
|||
let mut buf = String::with_capacity(1024);
|
||||
|
||||
for a in arguments {
|
||||
write!(buf, "{:?}", self.interner().dbg_deep(a)).expect("capacity");
|
||||
write!(buf, "{:?}", self.interner().dbg_stable(a)).expect("capacity");
|
||||
}
|
||||
|
||||
// lambda set should not matter; it should already be added as an argument
|
||||
// but the niche of the lambda name may be the only thing differentiating two different
|
||||
// implementations of a function with the same symbol
|
||||
write!(buf, "{:?}", name.niche().dbg_deep(self.interner())).expect("capacity");
|
||||
write!(buf, "{:?}", name.niche().dbg_stable(self.interner())).expect("capacity");
|
||||
|
||||
write!(buf, "{:?}", self.interner().dbg_deep(result)).expect("capacity");
|
||||
write!(buf, "{:?}", self.interner().dbg_stable(result)).expect("capacity");
|
||||
|
||||
// NOTE: due to randomness, this will not be consistent between runs
|
||||
let mut state = roc_collections::all::BuildHasher::default().build_hasher();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue