]> 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>
Fri, 26 Oct 2018 11:45:55 +0000 (13:45 +0200)
tests/Makefile.am
tests/control-flow/unassigned-captured-local-variable.test [new file with mode: 0644]

index ae97233734042013d5fccf645aac3b3a1e33206e..9bc3fc265d3dc31e9143a4e895f11e0eed3411ab 100644 (file)
@@ -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 (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 ();
+}