Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/compilers/src/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ impl Flattener {
// `loc.path` is expected to be different for each id because there can't be 2
// top-level declarations with the same name in the same file.
//
// Sorting by index loc.path in sorted files to make the renaming process
// deterministic.
// Sorting by index loc.path and loc.start in sorted files to make the renaming
// process deterministic.
ids.sort_by_key(|(_, loc)| {
self.ordered_sources.iter().position(|p| p == &loc.path).unwrap()
(self.ordered_sources.iter().position(|p| p == &loc.path).unwrap(), loc.start)
});
}
for (i, (id, loc)) in ids.iter().enumerate() {
Expand Down
Loading