effekt
effekt copied to clipboard
Fix namer to support recursive variable declarations
See @phischu's talk at Shonan.
The type of mutable variables cannot mention the variable itself. This should be allowed.
@phischu could you add the example from your talk here?
The following program typechecks:
def main() = {
var x = box { () => 3 };
x = box { () => x() };
x()
}
The type of x is inferred to be () => Int at {x}. However, when I try to annotate this type:
def main() = {
var x: () => Int at {x} = box { () => 3 };
x = box { () => x() };
x()
}
The program is rejected with "Could not resolve capture x".