From df48dc3836e29578acd792c7ef38f5874a43b20b Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 26 Oct 2018 13:41:01 +0200 Subject: [PATCH] tests: Add "captured unassigned local variable" test --- tests/Makefile.am | 1 + .../unassigned-captured-local-variable.test | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/control-flow/unassigned-captured-local-variable.test diff --git a/tests/Makefile.am b/tests/Makefile.am index ae9723373..9bc3fc265 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -144,6 +144,7 @@ TESTS = \ control-flow/nested-conditional.vala \ control-flow/switch.vala \ control-flow/sideeffects.vala \ + control-flow/unassigned-captured-local-variable.test \ control-flow/unassigned-local-block-variable.test \ control-flow/unassigned-local-variable.test \ control-flow/while-false.vala \ diff --git a/tests/control-flow/unassigned-captured-local-variable.test b/tests/control-flow/unassigned-captured-local-variable.test new file mode 100644 index 000000000..53c5ad3b5 --- /dev/null +++ b/tests/control-flow/unassigned-captured-local-variable.test @@ -0,0 +1,11 @@ +Invalid Code + +delegate void Func (); + +void main () { + string s; + Func foo = () => { + print ("%s", s); + }; + foo (); +} -- 2.47.2