A base-class is allowed to provide interface implementations for methods
and properties. If those exist without an explicit implementation in the
sub-class we then we end up finding the interface property itself. Using
that is obviously wrong and causes a cyclic call stack.
Fixes https://gitlab.gnome.org/GNOME/vala/issues/891
base_property = cl_prop.base_interface_property;
}
+ // Our base class provides this interface implementation
+ if (prop == base_property) {
+ continue;
+ }
+
var ciface = new CCodeIdentifier ("iface");
if (base_property.get_accessor != null && prop.get_accessor != null) {
objects/interfaces.vala \
objects/interface-generics.vala \
objects/interface-property-base-access.vala \
+ objects/interface-property-base-impl.vala \
objects/interface-property-delegate.vala \
objects/interface-property-override.vala \
objects/interface-virtual-override.vala \
--- /dev/null
+public interface IFoo : Object {
+ public abstract int prop { get; set; }
+}
+
+public class Foo : Object, IFoo {
+ public int prop { get; set; }
+}
+
+public class Bar : Foo, IFoo {
+}
+
+void main (){
+ IFoo bar = new Bar ();
+ bar.prop = 42;
+ assert (bar.prop == 42);
+}