https://bugzilla.gnome.org/show_bug.cgi?id=795225
objects/bug783897.vala \
objects/bug788964.vala \
objects/bug795225-1.test \
+ objects/bug795225-2.test \
+ objects/bug795225-3.test \
+ objects/bug795225-4.test \
errors/catch-error-code.vala \
errors/errors.vala \
errors/bug567181.vala \
--- /dev/null
+Invalid Code
+
+class Foo : Object {
+ int _fub = 0;
+
+ public int bar {
+ get { return _fub; }
+ set { _fub = value / 2; }
+ default = 42;
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+class Foo : Object {
+ int _fub = 0;
+
+ public int bar {
+ get { return _fub; }
+ default = 42;
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+class Foo : Object {
+ int _fub = 0;
+
+ public int bar {
+ set { _fub = value / 2; }
+ default = 42;
+ }
+}
+
+void main () {
+}
set_accessor.check (context);
}
+ if (initializer != null && field == null && !is_abstract) {
+ error = true;
+ Report.error (source_reference, "Property `%s' with custom `get' accessor and/or `set' mutator cannot have `default' value".printf (get_full_name ()));
+ return false;
+ }
+
if (initializer != null) {
initializer.check (context);
}