-
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.
- Loading branch information
1 parent
6299fc3
commit 5e456c9
Showing
3 changed files
with
79 additions
and
6 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,49 @@ | ||
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 don't know about any data constructor named X. Maybe make | ||
sure it's correctly spelled and that you've imported it: | ||
5 | Bar X -> 5 | ||
``` | ||
``` 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 don't know about any data constructor named X. Maybe make | ||
sure it's correctly spelled and that you've imported it: | ||
7 | Bar X -> 5 | ||
``` |