summaryrefslogtreecommitdiff
path: root/tests/chainup
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-12-20 21:34:20 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-12-20 21:36:45 +0100
commit60563fc8e5e795ec70512fcf386e058d2912e7c2 (patch)
tree160292e1532118c47bb60e61fe4fdf522680e3d9 /tests/chainup
parentc81d1f941e06a656deef48d11e795739c94dc8c4 (diff)
downloadvala-60563fc8e5e795ec70512fcf386e058d2912e7c2.tar.gz
codegen: Fix chain-up regression with real non-null struct parameters
Regression of b9035aaf17a9a97a070812a8ee83251fd3893b1e https://bugzilla.gnome.org/show_bug.cgi?id=791785
Diffstat (limited to 'tests/chainup')
-rw-r--r--tests/chainup/bug791785.vala23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/chainup/bug791785.vala b/tests/chainup/bug791785.vala
new file mode 100644
index 000000000..eb46b0141
--- /dev/null
+++ b/tests/chainup/bug791785.vala
@@ -0,0 +1,23 @@
+struct Foo {
+ public int i;
+}
+
+abstract class AbstractBar {
+ public Foo foo;
+
+ public AbstractBar (Foo foo) {
+ this.foo = foo;
+ }
+}
+
+class Bar : AbstractBar {
+ public Bar (Foo foo) {
+ base (foo);
+ }
+}
+
+void main () {
+ var bar = new Bar ({ 42 });
+ assert (bar.foo.i == 42);
+}
+