-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve type constructors in the types of constructor fields (#728)
- Loading branch information
1 parent
4d6f461
commit 7080bbe
Showing
5 changed files
with
34 additions
and
11 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
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
12 changes: 12 additions & 0 deletions
12
tests/golden_tests/desugar_file/fail_type_bad_rec_fn_adt.bend
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,12 @@ | ||
# Should give a type error in Erase when unifying the field of type Unit with the match type of Box | ||
type Box: | ||
Box {x: Unit} | ||
|
||
type Unit: | ||
Unit | ||
|
||
Erase: Box -> None | ||
(Erase (Box/Box x)) = (Erase x) | ||
|
||
main: None | ||
main = (Erase (Box/Box Unit/Unit)) |
7 changes: 7 additions & 0 deletions
7
tests/snapshots/desugar_file__fail_type_bad_rec_fn_adt.bend.snap
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,7 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/desugar_file/fail_type_bad_rec_fn_adt.bend | ||
--- | ||
[4m[1m[31mErrors:[0m | ||
In λa match a { Box/Box b: (Erase b); }: | ||
Can't unify '(Unit -> d)' and '(Box -> d)'. |