]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Test symbol resolution in closures
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 8 Aug 2012 18:54:27 +0000 (20:54 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 8 Aug 2012 18:54:44 +0000 (20:54 +0200)
tests/Makefile.am
tests/methods/symbolresolution.vala [new file with mode: 0644]

index 6de7a7bb3bb4ff1c139667082da6b85b3ba7e7ad..41cea9eadbf5a39abd89c8fafe21d2abc0cd73bc 100644 (file)
@@ -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 (file)
index 0000000..90fe97c
--- /dev/null
@@ -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 (() => { });
+}