summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codegen/valaccodebasemodule.vala2
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/objects/bug779955.vala20
3 files changed, 22 insertions, 1 deletions
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 3a68264d2..6c4755a3e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1779,7 +1779,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
notify_call.add_argument (get_property_canonical_cconstant (prop));
var get_accessor = prop.get_accessor;
- if (get_accessor != null) {
+ if (get_accessor != null && get_accessor.automatic_body) {
var property_type = prop.property_type;
var get_call = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_real_name (get_accessor)));
get_call.add_argument (new CCodeIdentifier (is_virtual ? "base" : "self"));
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4360e5eab..b1d3ea299 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -220,6 +220,7 @@ TESTS = \
objects/bug779038-2.test \
objects/bug779038-3.test \
objects/bug779219.vala \
+ objects/bug779955.vala \
errors/errors.vala \
errors/bug567181.vala \
errors/bug579101.vala \
diff --git a/tests/objects/bug779955.vala b/tests/objects/bug779955.vala
new file mode 100644
index 000000000..e67ef0ca8
--- /dev/null
+++ b/tests/objects/bug779955.vala
@@ -0,0 +1,20 @@
+public class Foo : Object {
+ int i = 42;
+
+ public int bar {
+ get {
+ return i;
+ }
+ set {
+ if (value == 42) {
+ i = 23;
+ }
+ }
+ }
+}
+
+void main () {
+ var f = new Foo ();
+ f.bar = 42;
+ assert (f.bar == 23);
+}