forked from unisonweb/unison
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a failing transcript for unisonweb#2822
- Loading branch information
Showing
2 changed files
with
102 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,53 @@ | ||
# Inability to reference a term or type with a name that has segments starting with an underscore | ||
|
||
```ucm:hide | ||
scratch/main> builtins.mergeio | ||
``` | ||
|
||
There should be no issue having terms with an underscore-led component | ||
|
||
```unison | ||
_a.blah = 2 | ||
b = _a.blah + 1 | ||
``` | ||
|
||
Or even that _are_ a single “blank” component | ||
|
||
```unison | ||
_b = 2 | ||
x = _b + 1 | ||
``` | ||
Types can also have underscore-led components. | ||
|
||
```unison | ||
unique type _a.Blah = A | ||
c : _a.Blah | ||
c = A | ||
``` | ||
|
||
And we should also be able to access underscore-led fields. | ||
|
||
```unison | ||
type Hello = {_value : Nat} | ||
doStuff = _value.modify | ||
``` | ||
|
||
But pattern matching shouldn’t bind to underscore-led names. | ||
|
||
```unison:error | ||
dontMap f = cases | ||
None -> false | ||
Some _used -> f _used | ||
``` | ||
|
||
But we can use them as unbound patterns. | ||
|
||
```unison | ||
dontMap f = cases | ||
None -> false | ||
Some _unused -> f 2 | ||
``` |
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 @@ | ||
# Inability to reference a term or type with a name that has segments starting with an underscore | ||
|
||
There should be no issue having terms with an underscore-led component | ||
|
||
``` unison | ||
_a.blah = 2 | ||
b = _a.blah + 1 | ||
``` | ||
|
||
``` ucm | ||
Loading changes detected in scratch.u. | ||
I couldn't figure out what .blah refers to here: | ||
3 | b = _a.blah + 1 | ||
I also don't know what type it should be. | ||
Some common causes of this error include: | ||
* Your current namespace is too deep to contain the | ||
definition in its subtree | ||
* The definition is part of a library which hasn't been | ||
added to this project | ||
* You have a typo in the name | ||
``` | ||
|
||
|
||
|
||
🛑 | ||
|
||
The transcript failed due to an error in the stanza above. The error is: | ||
|
||
|
||
I couldn't figure out what .blah refers to here: | ||
|
||
3 | b = _a.blah + 1 | ||
|
||
I also don't know what type it should be. | ||
|
||
Some common causes of this error include: | ||
* Your current namespace is too deep to contain the | ||
definition in its subtree | ||
* The definition is part of a library which hasn't been | ||
added to this project | ||
* You have a typo in the name | ||
|