Open YanaTes opened 3 years ago
Nice find!
I think it's an issue with implicit arguments rather than dependent types, since the following type-checks fine:
import Data.Vect
interface MyInterface (t : (n : Nat) -> Vect n Nat -> Type) where
myFunction : {n : Nat} -> {k : Nat} -> {v1 : Vect n Nat} -> {v2 : Vect k Nat} ->
t n v1 -> t k v2 -> t (n + k) (v1 ++ v2)
interface MyInterface t => MyExtendedInterface (t : (n : Nat) -> Vect n Nat -> Type) where
myId : {n : Nat} -> {v1 : Vect n Nat} -> t n v1 -> t n v1
It looks like implicit arguments don't play nice with interfaces at the moment, for example:
interface MyInterface (0 t : {n : Nat} -> Type) where
myConstant : t {n = Z}
gives:
Errors (1)
`-- line 2 col 2:
While processing left hand side of myConstant. Can't solve constraint between: ?t and ?_.
I believe @ohad is correct and it's the same issue as #660, albeit in a slightly different context (interface declarations get elaborated to datatype declarations).
Steps to Reproduce
Expected Behavior
Extending the interface.
Observed Behavior