-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a transcript to test empty
match
It currently fails.
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
```unison | ||
structural type Void = | ||
``` | ||
|
||
```ucm | ||
scratch/main> add | ||
``` | ||
|
||
We should be able to `match` on empty types like `Void`. | ||
|
||
```unison | ||
Void.absurdly : '{e} Void ->{e} a | ||
Void.absurdly v = match !v with | ||
``` | ||
|
||
```unison | ||
Void.absurdly : Void -> a | ||
Void.absurdly v = match v with | ||
``` | ||
|
||
And empty `cases` should also work. | ||
|
||
```unison | ||
Void.absurdly : Void -> a | ||
Void.absurdly = cases | ||
``` | ||
|
||
But empty function bodies are not allowed. | ||
|
||
```unison:error | ||
Void.absurd : Void -> a | ||
Void.absurd 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
``` unison | ||
structural type Void = | ||
``` | ||
|
||
``` ucm | ||
Loading changes detected in scratch.u. | ||
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`: | ||
structural type Void | ||
``` | ||
``` ucm | ||
scratch/main> add | ||
⍟ I've added these definitions: | ||
structural type Void | ||
``` | ||
We should be able to `match` on empty types like `Void`. | ||
|
||
``` unison | ||
Void.absurdly : '{e} Void ->{e} a | ||
Void.absurdly v = match !v with | ||
``` | ||
|
||
``` ucm | ||
Loading changes detected in scratch.u. | ||
😶 | ||
I expected some patterns after a match / with or cases but I | ||
didn't find any. | ||
2 | Void.absurdly v = match !v with | ||
``` | ||
|
||
|
||
|
||
🛑 | ||
|
||
The transcript failed due to an error in the stanza above. The error is: | ||
|
||
|
||
😶 | ||
|
||
I expected some patterns after a match / with or cases but I | ||
didn't find any. | ||
|
||
2 | Void.absurdly v = match !v with | ||
|
||
|