]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "captured unassigned local variable" test
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 26 Oct 2018 11:41:01 +0000 (13:41 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Oct 2018 20:43:09 +0000 (22:43 +0200)
tests/Makefile.am
tests/control-flow/unassigned-captured-local-variable.test [new file with mode: 0644]

index 7a2eeb8ef3ed4fd3840d734b79ed299b6791f34e..4e707572e77b681e1a51f213bccfa421e3a3c5dc 100644 (file)
@@ -143,6 +143,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 (file)
index 0000000..53c5ad3
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+delegate void Func ();
+
+void main () {
+       string s;
+       Func foo = () => {
+               print ("%s", s);
+       };
+       foo ();
+}