-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: require relative names in import{Wordy,Symboly}Id #5568
Changes from 2 commits
bad969d
0704755
73293b7
8896e87
a5e7d59
a71dd93
1d97895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
``` ucm | ||
scratch/main> builtins.merge lib.builtin | ||
|
||
Done. | ||
``` | ||
|
||
``` unison :error | ||
foo : Nat | ||
foo = | ||
use Nat .+ | ||
1 + 2 | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
I got confused here: | ||
|
||
3 | use Nat .+ | ||
|
||
|
||
I was surprised to find a '.' here. | ||
I was expecting one of these instead: | ||
|
||
* bang | ||
* binding | ||
* do | ||
* false | ||
* force | ||
* handle | ||
* if | ||
* lambda | ||
* let | ||
* newline or semicolon | ||
* pattern | ||
* quote | ||
* termLink | ||
* true | ||
* tuple | ||
* typeLink | ||
``` | ||
|
||
``` unison :error | ||
foo : Nat | ||
foo = | ||
use .lib.builtin.Nat + | ||
1 + 2 | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
😶 | ||
|
||
I was expecting something after the use keyword | ||
|
||
3 | use .lib.builtin.Nat + | ||
|
||
Here's a few examples of valid `use` statements: | ||
|
||
use math sqrt Introduces `sqrt` as a local alias for | ||
`math.sqrt` | ||
use List :+ Introduces `:+` as a local alias for | ||
`List.:+`. | ||
use .foo bar.baz Introduces `bar.baz` as a local alias for | ||
the absolute name `.foo.bar.baz` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we not want to allow absolute names for the first one? The example on line 65 suggests it as correct syntax. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a problem with allowing absolute names in certain places, I can make that change. My instinct was to simplify everything down to relative names, but that could be wrong. |
||
``` | ||
|
||
``` unison :error | ||
namespace .foo | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
I got confused here: | ||
|
||
1 | namespace .foo | ||
|
||
|
||
I was surprised to find a .foo here. | ||
``` | ||
|
||
``` unison :error | ||
unique[.foo] type Foo = Foo | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
I got confused here: | ||
|
||
1 | unique[.foo] type Foo = Foo | ||
|
||
|
||
I was surprised to find a .foo here. | ||
``` | ||
|
||
``` unison :error | ||
.foo> 17 | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
This looks like the start of an expression here | ||
|
||
1 | .foo> 17 | ||
|
||
but at the file top-level, I expect one of the following: | ||
|
||
- A binding, like .foo = 42 OR | ||
.foo : Nat | ||
.foo = 42 | ||
- A watch expression, like > .foo + 1 | ||
- An `ability` declaration, like unique ability Foo where ... | ||
- A `type` declaration, like structural type Optional a = None | Some a | ||
``` | ||
|
||
``` unison :error | ||
foo.> 17 | ||
``` | ||
|
||
``` ucm :added-by-ucm | ||
Loading changes detected in scratch.u. | ||
|
||
I got confused here: | ||
|
||
1 | foo.> 17 | ||
|
||
|
||
I was surprised to find a foo.> here. | ||
I was expecting one of these instead: | ||
|
||
* ability | ||
* bang | ||
* binding | ||
* do | ||
* false | ||
* force | ||
* handle | ||
* if | ||
* lambda | ||
* let | ||
* namespace | ||
* newline or semicolon | ||
* quote | ||
* termLink | ||
* true | ||
* tuple | ||
* type | ||
* typeLink | ||
* use | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, I'm not sure which one of these it wants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know, the error messages are atrocious :|