// Take x, return a function that adds x to its argument fun makeAdder(x: int): (int) -> int = fun (y: int) -> x + y; // x is captured from the surrounding scope let add1: (int) -> int = makeAdder(1); let add2: (int) -> int = makeAdder(2); // These assertions succeed in the interpreter, but fail in code generation! assert(add1(40) = 41); assert(add2(40) = 42)