AndrasKovacs/elaboration-zoo

Elaboration seems to not handle shadows names correctly

atennapel opened this issue · 0 comments

I think I've found an error with elaboration if there is shadowing.

Term:
\(t : *) (f : t -> t) (t : *) x. f x
Typechecked as:
(t : *) -> (f : t -> t) -> (t$0 : *) -> (x : t$0) -> t$0
Elaborated term:
\(t : *) (f : t -> t) (t : *) (x : t). f x

x should be typed as the outer t not the inner one.

It may have something to do with the fact that abstractions keep their surface name in this line (x):

Lam x <$> check (Cxt ((x, Just v):_vals) ((x, Bound a):_types)) t (b v)