Skip to content

Commit

Permalink
Merge pull request #4419 from unisonweb/travis/4415
Browse files Browse the repository at this point in the history
Fix name resolution bug in the parser
  • Loading branch information
mergify[bot] authored Nov 22, 2023
2 parents bc0788b + 1facd86 commit 79eeee7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parser-typechecker/src/Unison/UnisonFile/Names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ variableCanonicalizer vs =
suffix <- Name.suffixes n
pure (Var.named (Name.toText suffix), v)
where
done xs = Map.fromList [ (k, v) | (k, nubOrd -> [v]) <- Map.toList xs ]
done xs = Map.fromList [ (k, v) | (k, nubOrd -> [v]) <- Map.toList xs ] <> Map.fromList [(v,v) | v <- vs]

-- This function computes hashes for data and effect declarations, and
-- also returns a function for resolving strings to (Reference, ConstructorId)
Expand Down
5 changes: 5 additions & 0 deletions unison-src/transcripts/fix4415.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

```unison
unique type Foo = Foo
unique type sub.Foo =
```
18 changes: 18 additions & 0 deletions unison-src/transcripts/fix4415.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

```unison
unique type Foo = Foo
unique type sub.Foo =
```

```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
unique type Foo
unique type sub.Foo
```

0 comments on commit 79eeee7

Please sign in to comment.