[vala/wip/transform: 99/106] tests: "??" evaluates both of sides of expression when right side throws error
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 99/106] tests: "??" evaluates both of sides of expression when right side throws error
- Date: Mon, 4 Feb 2019 09:28:19 +0000 (UTC)
commit 7871acf100a93d5c35081ef8b0fe79bf1eab564c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Nov 8 15:02:24 2016 +0100
tests: "??" evaluates both of sides of expression when right side throws error
https://gitlab.gnome.org/GNOME/vala/issues/534
tests/Makefile.am | 1 +
tests/control-flow/bug764440.vala | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 29c41d3ba..760f0966f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -161,6 +161,7 @@ TESTS = \
control-flow/bug691514.vala \
control-flow/bug736774-1.vala \
control-flow/bug736774-2.vala \
+ control-flow/bug764440.vala \
control-flow/bug790903.test \
control-flow/bug790903-2.test \
control-semantic/argument-extra.test \
diff --git a/tests/control-flow/bug764440.vala b/tests/control-flow/bug764440.vala
new file mode 100644
index 000000000..6f1caaece
--- /dev/null
+++ b/tests/control-flow/bug764440.vala
@@ -0,0 +1,17 @@
+errordomain FooError {
+ BAR;
+}
+
+unowned string get_bar () throws FooError {
+ throw new FooError.BAR ("bar");
+}
+
+void main () {
+ try {
+ unowned string? foo = "foo";
+ unowned string bar = foo ?? get_bar ();
+ print ("%s\n", bar);
+ } catch {
+ assert_not_reached ();
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]