mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow using 'var' to declare lambdas in functions.
This commit is contained in:
8
test/test_suite/lambda/var_lambda.c3
Normal file
8
test/test_suite/lambda/var_lambda.c3
Normal file
@@ -0,0 +1,8 @@
|
||||
module test;
|
||||
import std;
|
||||
fn void main()
|
||||
{
|
||||
var x = fn int(int y) { return y * 2; };
|
||||
io::printn(x(4));
|
||||
io::printn(x(3));
|
||||
}
|
||||
Reference in New Issue
Block a user