Idris-dev
Idris-dev copied to clipboard
Overly eager implicitly bound name checker
Steps to Reproduce
- Create a file
Sample.idrwith the following contents:
record Foo where
constructor MkFoo
someN : Nat
somePrf : someN = S someNPred
-- somePrf : someNPred `LT` someN -- this works fine
- Start up a fresh Idris repl as in
idris. - Do
:l Sample.idr
Expected Behavior
The file loads fine without any warnings.
Observed Behavior
Type checking ./Sample.idr
Sample.idr:4:13-17:
|
4 | somePrf : someN = S someNPred
| ~~~~~
someN is bound as an implicit
Did you mean to refer to Main.Foo.someN?
Note that :doc Foo renders the second occurrence of someN as if it's not an implicit but a reference to the ctor argument, as expected. And, in general, the type behaves as expected.
Also note that using the somePrf version with the LT predicate (as in the commented source line) doesn't give this warning.