repo.or.cz
/
vala-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
codegen: Fix array size variable on assignment
[vala-lang.git]
/
tests
/
asynchronous
/
closures.vala
blob
791010c924882df7361761460c79c2822dcc52a2
1
delegate
void
Func
();
2
3
MainLoop main_loop
;
4
5
async
void
foo
(
string
baz
) {
6
string
bar
=
"hello"
;
7
Func foobar
= () => {
8
bar
=
baz
;
9
};
10
foobar
();
11
assert
(
bar
==
"world"
);
12
13
Idle
.
add
(
foo
.
callback
);
14
yield
;
15
16
main_loop
.
quit
();
17
}
18
19
void
main
() {
20
foo
.
begin
(
"world"
);
21
22
main_loop
=
new
MainLoop
(
null
,
false
);
23
main_loop
.
run
();
24
}
25