Open buzden opened 3 months ago
It looks like an Idris bug:
> getFC `((Nat) -> Nat)
MkFC (Virtual Interactive) (0, 8) (0, 20)
> getFC `((arg : Nat) -> Nat)
MkFC (Virtual Interactive) (0, 9) (0, 12)
In the second case, FC points only to the name of the argument.
Same problem with messages from the Idris2 compiler:
Error: While processing right hand side of test1. When unifying:
Type
and:
()
Mismatch between: Type and ().
BadMessages:4:9--4:21
1 | module BadMessages
2 |
3 | test1 : ()
4 | test1 = (Nat) -> Nat
^^^^^^^^^^^^
Error: While processing right hand side of test2. When unifying:
Type
and:
()
Mismatch between: Type and ().
BadMessages:7:10--7:13
3 | test1 : ()
4 | test1 = (Nat) -> Nat
5 |
6 | test2 : ()
7 | test2 = (arg : Nat) -> Nat
^^^
Derived generators currently cannot have unnamed explicit arguments, e.g. this is wrong and should fail:
Also, there cannot be any unused explicit arguments, e.g. this is wrong and should fail:
And both these derivation indeed fail, as should. But their error messages are a bit misleading:
They should highlight the whole type, or at least argument's name (if present) instead, something like this:
and one of these:
or
or