-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5303 from unisonweb/24-08-27-parser-fix
bugfix: not-found or ambiguous constructor treated as var
- Loading branch information
Showing
5 changed files
with
126 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This transcripts demonstrates that pattern matching on a "constructor" (defined as a variable that begins with a capital | ||
letter) that is either not found or ambiguouus fails. Previously, it would be treated as a variable binding. | ||
|
||
```ucm | ||
scratch/main> builtins.merge | ||
``` | ||
|
||
```unison:error | ||
type Foo = Bar Nat | ||
foo : Foo -> Nat | ||
foo = cases | ||
Bar X -> 5 | ||
``` | ||
|
||
```unison:error | ||
type Foo = Bar A | ||
type A = X | ||
type B = X | ||
foo : Foo -> Nat | ||
foo = cases | ||
Bar X -> 5 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
This transcripts demonstrates that pattern matching on a "constructor" (defined as a variable that begins with a capital | ||
letter) that is either not found or ambiguouus fails. Previously, it would be treated as a variable binding. | ||
|
||
``` ucm | ||
scratch/main> builtins.merge | ||
Done. | ||
``` | ||
``` unison | ||
type Foo = Bar Nat | ||
foo : Foo -> Nat | ||
foo = cases | ||
Bar X -> 5 | ||
``` | ||
|
||
``` ucm | ||
Loading changes detected in scratch.u. | ||
❓ | ||
I couldn't resolve any of these symbols: | ||
5 | Bar X -> 5 | ||
Symbol Suggestions | ||
X No matches | ||
``` | ||
``` unison | ||
type Foo = Bar A | ||
type A = X | ||
type B = X | ||
foo : Foo -> Nat | ||
foo = cases | ||
Bar X -> 5 | ||
``` | ||
|
||
``` ucm | ||
Loading changes detected in scratch.u. | ||
❓ | ||
I couldn't resolve any of these symbols: | ||
7 | Bar X -> 5 | ||
Symbol Suggestions | ||
X A.X | ||
B.X | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters