The following unexpectedly typechecks successfully:
theory TestCase : ur:?LF =
a : type ❙
b : type ❙
x : a ❙
f : b ⟶ a ❘ = [x: b] x ❙
❚
Problem: This should not typecheck. It typechecks because the token x in the definiens of f is resolved to a reference to the constant x : a and not to the variable bound in [x]. Such weird resolutions (from the user's POV) also happen in right-hand sides of view assignments.
Suggestion: Always prefer resolving tokens to bound variables over resolving them to symbols or notations.
The following unexpectedly typechecks successfully:
Problem: This should not typecheck. It typechecks because the token
x
in the definiens off
is resolved to a reference to the constantx : a
and not to the variable bound in[x]
. Such weird resolutions (from the user's POV) also happen in right-hand sides of view assignments.Suggestion: Always prefer resolving tokens to bound variables over resolving them to symbols or notations.