Skip to content

Commit

Permalink
fix bug in suffixifyByHash / suffixifyByHashName
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellwrosen committed Sep 26, 2024
1 parent cc4af4b commit 1e44418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unison-core/src/Unison/Name.hs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ suffixifyByHash fqn rel =

isOk :: Name -> Bool
isOk suffix =
Set.size matchingRefs == 1 || matchingRefs == allRefs
matchingRefs == allRefs
where
matchingRefs :: Set r
matchingRefs =
Expand All @@ -598,7 +598,7 @@ suffixifyByHashName fqn rel =

isOk :: Name -> Bool
isOk suffix =
(Set.size matchingRefs == 1 || matchingRefs == allRefs)
matchingRefs == allRefs
-- Don't use a suffix of 2+ aliases if any of then are non-local names
&& case numLocalNames of
0 -> True
Expand Down
2 changes: 2 additions & 0 deletions unison-src/transcripts/fix-5374.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ scratch/main> view thing
thing : Nat
thing =
use Nat +
use indirect foo
foo + foo
scratch/main> edit thing
Expand All @@ -56,6 +57,7 @@ scratch/main> edit thing
thing : Nat
thing =
use Nat +
use indirect foo
foo + foo
```

0 comments on commit 1e44418

Please sign in to comment.