[vala/0.36: 122/173] tests: Add chain-up regression test for real non-null struct parameters



commit 887980696d3fc7239a925276e85fbac39c412a2c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Dec 20 21:34:20 2017 +0100

    tests: Add chain-up regression test for real non-null struct parameters
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791785

 tests/Makefile.am            |    1 +
 tests/chainup/bug791785.vala |   23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 85780c1..3d5507d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -58,6 +58,7 @@ TESTS = \
        chainup/struct-base-foo.vala \
        chainup/struct-this.vala \
        chainup/struct-this-foo.vala \
+       chainup/bug791785.vala \
        pointers/bug590641.vala \
        namespaces.vala \
        methods/lambda.vala \
diff --git a/tests/chainup/bug791785.vala b/tests/chainup/bug791785.vala
new file mode 100644
index 0000000..eb46b01
--- /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);
+}
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]