module Clash
import Data.Fin
data X : Bool -> Type where
MkX : Nat -> X b
f : X b -> Nat
f (MkX n) = n
data D : Bool -> Type where
MkD : Fin (f (MkX 0)) -> D b
Here the implicit b argument of f and MkX has nothing to do with the implicit b in the output type, so Idris does the right thing by introducing an extra implicit of type Bool. The problem is it uses the same name.
Expected Behavior
The MkD type should be
{b : Bool} -> {b0 : Bool} -> Fin (f {b = b0} (MkX {b = b0} 0)) -> D b
I think this is mostly pretty printing issue: internally these two bs are distinct, one being machine-generated. It's the pretty-printer who displays MN i "b" as "b".
Steps to Reproduce
Here is the source:
Here the implicit
b
argument off
andMkX
has nothing to do with the implicitb
in the output type, so Idris does the right thing by introducing an extra implicit of typeBool
. The problem is it uses the same name.Expected Behavior
The
MkD
type should beObserved Behavior