summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Brosch <flo.brosch@gmail.com>2012-08-08 20:54:27 +0200
committerJürg Billeter <j@bitron.ch>2012-08-08 20:54:44 +0200
commit2c504c9025237dac72c29a6ce5d2ee92ecc2d337 (patch)
tree5b2910da4d68f9a94e4534a265fd67313299bfac
parenta39412e86d958bf71a2826c5b98b1527048b7988 (diff)
downloadvala-2c504c9025237dac72c29a6ce5d2ee92ecc2d337.tar.gz
Test symbol resolution in closures
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/methods/symbolresolution.vala17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6de7a7bb3..41cea9ead 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,6 +35,7 @@ TESTS = \
namespaces.vala \
methods/lambda.vala \
methods/closures.vala \
+ methods/symbolresolution.vala \
methods/bug595538.vala \
methods/bug596726.vala \
methods/bug597426.vala \
diff --git a/tests/methods/symbolresolution.vala b/tests/methods/symbolresolution.vala
new file mode 100644
index 000000000..90fe97c30
--- /dev/null
+++ b/tests/methods/symbolresolution.vala
@@ -0,0 +1,17 @@
+public class Class {
+ public delegate void Foo ();
+
+ public void foo () {
+ assert_not_reached ();
+ }
+
+ public void test (Foo foo) {
+ Foo func = () => { foo (); };
+ func ();
+ }
+}
+
+void main () {
+ var cl = new Class ();
+ cl.test (() => { });
+}