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 #3149 from unisonweb/fix/3037
Some ability checking adjustments
- Loading branch information
Showing
3 changed files
with
108 additions
and
47 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,18 @@ | ||
```ucm:hide | ||
.> builtins.merge | ||
``` | ||
|
||
Tests for an unsound case of ability checking that was erroneously being | ||
accepted before. In certain cases, abilities were able to be added to rows in | ||
invariant positions. | ||
|
||
```unison:error | ||
structural type Runner g = Runner (forall a. '{g} a -> {} a) | ||
pureRunner : Runner {} | ||
pureRunner = Runner base.force | ||
-- this compiles, but shouldn't the effect type parameter on Runner be invariant? | ||
runner : Runner {IO} | ||
runner = pureRunner | ||
``` |
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,23 @@ | ||
Tests for an unsound case of ability checking that was erroneously being | ||
accepted before. In certain cases, abilities were able to be added to rows in | ||
invariant positions. | ||
|
||
```unison | ||
structural type Runner g = Runner (forall a. '{g} a -> {} a) | ||
pureRunner : Runner {} | ||
pureRunner = Runner base.force | ||
-- this compiles, but shouldn't the effect type parameter on Runner be invariant? | ||
runner : Runner {IO} | ||
runner = pureRunner | ||
``` | ||
|
||
```ucm | ||
The expression in red needs the {IO} ability, but this location does not have access to any abilities. | ||
8 | runner = pureRunner | ||
``` |