-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ ux, derive ] Improve an error message of a function in a constructor
- Loading branch information
Showing
6 changed files
with
51 additions
and
1 deletion.
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
21 changes: 21 additions & 0 deletions
21
tests/derivation/least-effort/run/regression/function-in-cons/DerivedGen.idr
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,21 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
%default total | ||
|
||
data X : Type where | ||
MkX : (Unit -> Unit) -> X | ||
|
||
Show X where | ||
show (MkX f) = "MkX f" | ||
|
||
%language ElabReflection | ||
|
||
checkedGen : Fuel -> Gen MaybeEmpty X | ||
checkedGen = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
|
||
main : IO () | ||
main = runGs | ||
[ G $ \fl => checkedGen fl | ||
] |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/function-in-cons/RunDerivedGen.idr
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 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/function-in-cons/derive.ipkg
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 @@ | ||
../_common/derive.ipkg |
25 changes: 25 additions & 0 deletions
25
tests/derivation/least-effort/run/regression/function-in-cons/expected
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,25 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Sorry, I can't find any elaboration which works. All errors: | ||
Possible error: | ||
Error during reflection: Fields with function types are not supported in constructors | ||
|
||
DerivedGen:8:10--8:22 | ||
4 | | ||
5 | %default total | ||
6 | | ||
7 | data X : Type where | ||
8 | MkX : (Unit -> Unit) -> X | ||
^^^^^^^^^^^^ | ||
|
||
Possible error: | ||
Error during reflection: No arguments in the generator function signature, at least a fuel argument must be present | ||
|
||
DerivedGen:16:14--16:23 | ||
12 | | ||
13 | %language ElabReflection | ||
14 | | ||
15 | checkedGen : Fuel -> Gen MaybeEmpty X | ||
16 | checkedGen = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
^^^^^^^^^ | ||
|
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/function-in-cons/run
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 @@ | ||
../_common/run |