[vala] girparser: Do not assume method with same name of property is a getter



commit 4713308b17d4059b4c1132cde2bc1f27a94e83cb
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue May 24 20:10:05 2011 +0200

    girparser: Do not assume method with same name of property is a getter

 vala/valagirparser.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 3afc6c4..a1038c2 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -687,8 +687,6 @@ public class Vala.GirParser : CodeVisitor {
 						parser.process_async_method (this);
 					}
 				} else if (symbol is Property) {
-					var getter = parent.lookup ("get_%s".printf (name));
-					var setter = parent.lookup ("set_%s".printf (name));
 					var colliding = parent.lookup_all (name);
 					foreach (var node in colliding) {
 						if (node.symbol is Signal) {
@@ -696,10 +694,12 @@ public class Vala.GirParser : CodeVisitor {
 							node.processed = true;
 							node.merged = true;
 						} else if (node.symbol is Method) {
-							// try assuming it's the getter
-							getter = node;
+							// getter in C, but not in Vala
+							node.merged = true;
 						}
 					}
+					var getter = parent.lookup ("get_%s".printf (name));
+					var setter = parent.lookup ("set_%s".printf (name));
 					var prop = (Property) symbol;
 					if (prop.no_accessor_method) {
 						// property getter and setter must both match, otherwise it's NoAccessorMethod



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