[vala] Test symbol resolution in closures



commit 2c504c9025237dac72c29a6ce5d2ee92ecc2d337
Author: Florian Brosch <flo brosch gmail com>
Date:   Wed Aug 8 20:54:27 2012 +0200

    Test symbol resolution in closures

 tests/Makefile.am                   |    1 +
 tests/methods/symbolresolution.vala |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6de7a7b..41cea9e 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 0000000..90fe97c
--- /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 (() => { });
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]