cogent icon indicating copy to clipboard operation
cogent copied to clipboard

lambda term cannot access toplevel constants

Open gteege opened this issue 5 years ago • 0 comments

Defined constants cannot be used in lambda expressions. The docs say "no free variables", but is it really intended that this also applies to toplevel defined constants?

Example:

c : U32
c = 0

f : () -> U32
f () = (\() => c) ()

causes the error message:

Parsing...
Resolving dependencies...
Typechecking...
cogent: TODO: closures not implemented

It works if a defined function is used instead.

gteege avatar Sep 23 '19 12:09 gteege