summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-01-21 17:56:28 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-01-21 18:01:18 +0100
commit04806bb5df09f07aab7903222ecee2244c7a9f70 (patch)
tree0646ea4cfc05c6ed0c23abea1905918a95af7349 /tests
parented421a9aa362d48f778e4a8e22f1d4a763d6beea (diff)
downloadvala-04806bb5df09f07aab7903222ecee2244c7a9f70.tar.gz
codegen: Cast instance parameter in member-initializer for base-properties
This fixes warnings issued with -Wincompatible-pointer-types Fixes https://gitlab.gnome.org/GNOME/vala/issues/899
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/objects/member-initializer-base-properties.vala19
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c3b44aa7f..24f9d1622 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -354,6 +354,7 @@ TESTS = \
objects/interface-property-delegate.vala \
objects/interface-property-override.vala \
objects/interface-virtual-override.vala \
+ objects/member-initializer-base-properties.vala \
objects/methods.vala \
objects/paramspec.vala \
objects/plugin-module-init.vala \
diff --git a/tests/objects/member-initializer-base-properties.vala b/tests/objects/member-initializer-base-properties.vala
new file mode 100644
index 000000000..b21956d29
--- /dev/null
+++ b/tests/objects/member-initializer-base-properties.vala
@@ -0,0 +1,19 @@
+interface IFoo {
+ public abstract string prop { get; set; }
+}
+
+class Bar {
+ public virtual string prop_v { get; set; }
+}
+
+class Foo : Bar, IFoo {
+ public string prop { get; set; }
+ public override string prop_v { get; set; }
+}
+
+void main() {
+ var foo = new Foo () {
+ prop = "bar",
+ prop_v = "bar"
+ };
+}