-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ ux ] Improve error messages in obscure cases
- Loading branch information
Showing
18 changed files
with
116 additions
and
45 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
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `a` is not a top-level data definition | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (Maybe a) | ||
^^^ | ||
06 | | ||
07 | %language ElabReflection | ||
08 | | ||
09 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (Maybe a) | ||
10 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `b` is not a top-level data definition | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty b) => (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (a, b) | ||
^^^ | ||
06 | | ||
07 | %language ElabReflection | ||
08 | | ||
09 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty b) => (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (a, b) | ||
10 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
14 changes: 7 additions & 7 deletions
14
tests/derivation/core/norec t-p.--.. w_ext 003-neg/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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: All arguments of the target type must be different | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (a, a) | ||
^^ | ||
06 | | ||
07 | %language ElabReflection | ||
08 | | ||
09 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (a, a) | ||
10 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
14 changes: 7 additions & 7 deletions
14
tests/derivation/core/norec t-p.--.. w_ext 004-neg/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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type's argument must be a variable name | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => (Fuel -> Gen MaybeEmpty b) => Gen MaybeEmpty (a, b, a) | ||
^^ | ||
06 | | ||
07 | %language ElabReflection | ||
08 | | ||
09 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => (Fuel -> Gen MaybeEmpty b) => Gen MaybeEmpty (a, b, a) | ||
10 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `a` is not a top-level data definition | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
10 | | ||
11 | Show a => Show (X a) where | ||
12 | show (MkX m) = "MkX \{show m}" | ||
13 | | ||
14 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => Gen MaybeEmpty (X a) | ||
^^^ | ||
15 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `a` is not a top-level data definition | ||
Error: While processing right hand side of checkedGen. Error during reflection: Name `a` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
DerivedGen:1 | ||
10 | | ||
11 | Show a => Show b => Show (X a b) where | ||
12 | show (MkX m) = "MkX \{show m}" | ||
13 | | ||
14 | checkedGen : Fuel -> (Fuel -> Gen MaybeEmpty a) => (Fuel -> Gen MaybeEmpty b) => Gen MaybeEmpty (X a b) | ||
^^^ | ||
15 | checkedGen = deriveGen | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
2 changes: 1 addition & 1 deletion
2
tests/derivation/inputvalidation/bad-args-in-target-type/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
16 changes: 16 additions & 0 deletions
16
tests/derivation/inputvalidation/params-before-fuel/ValidateInput.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,16 @@ | ||
module ValidateInput | ||
|
||
import Deriving.DepTyCheck.Gen | ||
|
||
%language ElabReflection | ||
|
||
%default total | ||
|
||
data X : Fin n -> Fin n -> Type where | ||
MkX : X {n=10} 5 6 | ||
|
||
n_is_fully_out : Fuel -> (a, b : _) -> Gen MaybeEmpty $ X a b | ||
n_is_fully_out = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
|
||
n_mentioned_in_wrong_place : Fuel -> (a, b : Fin n) -> Gen MaybeEmpty $ X a b | ||
n_mentioned_in_wrong_place = deriveGen @{MainCoreDerivator @{LeastEffort}} |
47 changes: 47 additions & 0 deletions
47
tests/derivation/inputvalidation/params-before-fuel/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,47 @@ | ||
1/1: Building ValidateInput (ValidateInput.idr) | ||
Error: While processing right hand side of n_is_fully_out. Sorry, I can't find any elaboration which works. All errors: | ||
Possible error: | ||
Error during reflection: Name `{n:3660}` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); looks like it is an implicit parameter of some underdeclared type; specify types with more precision | ||
|
||
ValidateInput:1 | ||
09 | data X : Fin n -> Fin n -> Type where | ||
10 | MkX : X {n=10} 5 6 | ||
11 | | ||
12 | n_is_fully_out : Fuel -> (a, b : _) -> Gen MaybeEmpty $ X a b | ||
13 | n_is_fully_out = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Possible error: | ||
Error during reflection: No arguments in the generator function signature, at least a fuel argument must be present | ||
|
||
ValidateInput:2 | ||
09 | data X : Fin n -> Fin n -> Type where | ||
10 | MkX : X {n=10} 5 6 | ||
11 | | ||
12 | n_is_fully_out : Fuel -> (a, b : _) -> Gen MaybeEmpty $ X a b | ||
13 | n_is_fully_out = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
^^^^^^^^^ | ||
|
||
Error: While processing right hand side of n_mentioned_in_wrong_place. Sorry, I can't find any elaboration which works. All errors: | ||
Possible error: | ||
Error during reflection: Name `n` is used in target's type, but is not a generated or given parameter (goes after the fuel argument); did you forget to add one? | ||
|
||
ValidateInput:3 | ||
12 | n_is_fully_out : Fuel -> (a, b : _) -> Gen MaybeEmpty $ X a b | ||
13 | n_is_fully_out = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
14 | | ||
15 | n_mentioned_in_wrong_place : Fuel -> (a, b : Fin n) -> Gen MaybeEmpty $ X a b | ||
16 | n_mentioned_in_wrong_place = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Possible error: | ||
Error during reflection: No arguments in the generator function signature, at least a fuel argument must be present | ||
|
||
ValidateInput:4 | ||
12 | n_is_fully_out : Fuel -> (a, b : _) -> Gen MaybeEmpty $ X a b | ||
13 | n_is_fully_out = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
14 | | ||
15 | n_mentioned_in_wrong_place : Fuel -> (a, b : Fin n) -> Gen MaybeEmpty $ X a b | ||
16 | n_mentioned_in_wrong_place = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
^^^^^^^^^ | ||
|
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 |
1 change: 1 addition & 0 deletions
1
tests/derivation/inputvalidation/params-before-fuel/validate-input.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/validate-input.ipkg |
2 changes: 1 addition & 1 deletion
2
tests/derivation/inputvalidation/unexpected-gen-target/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