summaryrefslogtreecommitdiff
path: root/tests/control-semantic
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-10-24 14:15:56 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-10-24 14:34:08 +0200
commite679740751b4fde1d40103f8a84fba0fed1ff9a2 (patch)
treeccb32bb2c445b70f8163cea0c56467ba65ea8e7a /tests/control-semantic
parentb41694a099ed010c480d1aa72d507a050ebeb058 (diff)
downloadvala-e679740751b4fde1d40103f8a84fba0fed1ff9a2.tar.gz
vala: Don't falsely resolve binary-expression to bool
Fixes https://gitlab.gnome.org/GNOME/vala/issues/869
Diffstat (limited to 'tests/control-semantic')
-rw-r--r--tests/control-semantic/condition-not-boolean.test7
-rw-r--r--tests/control-semantic/expression-not-boolean.test5
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/control-semantic/condition-not-boolean.test b/tests/control-semantic/condition-not-boolean.test
new file mode 100644
index 000000000..7ba2130e9
--- /dev/null
+++ b/tests/control-semantic/condition-not-boolean.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+void main () {
+ if (true != false & 0) {
+ assert_not_reached ();
+ }
+}
diff --git a/tests/control-semantic/expression-not-boolean.test b/tests/control-semantic/expression-not-boolean.test
new file mode 100644
index 000000000..2be02e98d
--- /dev/null
+++ b/tests/control-semantic/expression-not-boolean.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+ bool foo = true != false & 0;
+}