The following code compiles okay in Idris2:
C : Nat
C = 2
claim : C = 2
claim = Refl
but it fails if C is not capitalized:
c : Nat
c = 2
claim : c = 2
claim = Refl
The error message is
Warning: We are about to implicitly bind the following lowercase names. You may be unintentionally shadowing the associated global definitions: c is shadowing Main.c Error: While processing right hand side of claim. When unifying: 2 = 2 and: c = 2 Mismatch between: 2 and c.
Is there a way to tell Idris compiler not to shadow lowercase global names in types?
I don't know if there's a compiler option or the like, but you can qualify c. If it's in module Foo, use
c : Nat
c = 2
claim : Foo.c = 2
claim = Refl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With