cedille icon indicating copy to clipboard operation
cedille copied to clipboard

Can't apply erased arguments to kinds imported from parametrized module

Open ionathanch opened this issue 3 years ago โ€ข 1 comments

Suppose I had a file with the following:

module P (T: โ˜…) {t: T}.
U : โ˜… = T.
๐’Œ = โ˜….

In a different file where I import this, I can't apply a second argument to ๐’Œ. If I try to make it erased, there's a parse error, and if I don't mark it as erased (which I think is the correct option), there's a "Mismatched argument erasure" error.

import P.
module Q (T: โ˜…) (t: T).
U' : โ˜… = U ยทT t. -- works fine
๐’Œ' = ๐’Œ ยทT -t     -- doesn't work
๐’Œ'' = ๐’Œ ยทT t     -- doesn't work either

I know I can import a module applied to arguments after the file's module declaration to avoid this error, but my current use-case looks something more like this:

import P.
module Q (T: โ˜…) {t: T} (R: ๐’Œ ยทT t) {u: U ยทT t}

ionathanch avatar Jan 11 '22 23:01 ionathanch

Out of curiosity I went to find where the error was coming from and it looks like it's here: https://github.com/cedille/cedille/blob/master/src/classify.agda#L736 I think since types effectively ignore whether an erased parameter argument is applied as erased or not (well, you can't apply erased arguments to types at all I suppose), so should kinds...

ionathanch avatar Jan 12 '22 03:01 ionathanch