Skip to content

Commit

Permalink
Merge pull request #5321 from unisonweb/fix-5320
Browse files Browse the repository at this point in the history
bugfix: make the term parser consider `lower.Upper` a constructor
  • Loading branch information
aryairani authored Sep 1, 2024
2 parents 3959a67 + 1b741a2 commit 4284b1d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parser-typechecker/src/Unison/Syntax/TermParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ parsePattern = label "pattern" root
pure (Set.findMin s <$ tok)
| otherwise -> die names tok s
where
isLower = Text.all Char.isLower . Text.take 1 . Name.toText
isLower = Text.all Char.isLower . Text.take 1 . NameSegment.toUnescapedText . Name.lastSegment
isIgnored n = Text.take 1 (Name.toText n) == "_"
die :: Names -> L.Token (HQ.HashQualified Name) -> Set ConstructorReference -> P v m a
die names hq s = case L.payload hq of
Expand Down
8 changes: 8 additions & 0 deletions unison-src/transcripts/fix-5320.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```ucm
scratch/main> builtins.merge lib.builtin
```

```unison:error
foo = cases
bar.Baz -> 5
```
29 changes: 29 additions & 0 deletions unison-src/transcripts/fix-5320.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
``` ucm
scratch/main> builtins.merge lib.builtin
Done.
```
``` unison
foo = cases
bar.Baz -> 5
```

``` ucm
Loading changes detected in scratch.u.
I couldn't resolve any of these symbols:
2 | bar.Baz -> 5
Symbol Suggestions
bar.Baz No matches
```

0 comments on commit 4284b1d

Please sign in to comment.