[vala/0.42] tests: Add "captured unassigned local variable" test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.42] tests: Add "captured unassigned local variable" test
- Date: Sat, 27 Oct 2018 21:12:42 +0000 (UTC)
commit 95efd695ed53f135a9960507f8879ac74e80c612
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri Oct 26 13:41:01 2018 +0200
tests: Add "captured unassigned local variable" test
tests/Makefile.am | 1 +
tests/control-flow/unassigned-captured-local-variable.test | 11 +++++++++++
2 files changed, 12 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7a2eeb8ef..4e707572e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
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 ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]