From 2c504c9025237dac72c29a6ce5d2ee92ecc2d337 Mon Sep 17 00:00:00 2001 From: Florian Brosch Date: Wed, 8 Aug 2012 20:54:27 +0200 Subject: [PATCH] Test symbol resolution in closures --- tests/Makefile.am | 1 + tests/methods/symbolresolution.vala | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/methods/symbolresolution.vala 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 (() => { }); +} -- 2.47.2