[vala/staging: 1/2] girparser: Fix instance method detection
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 1/2] girparser: Fix instance method detection
- Date: Fri, 16 Sep 2016 06:10:25 +0000 (UTC)
commit 8df6a4491cf64d741a47197b2bbdea0dbd97552e
Author: Simon Werbeck <simon werbeck gmail com>
Date: Mon Jun 30 09:39:59 2014 +0200
girparser: Fix instance method detection
Instance methods that were falsely declared as static in gir files were
never picked up because of a bug in the girparser. Unfortunately, while
this patch fixes detection, nothing can be done about breaking API.
https://bugzilla.gnome.org/show_bug.cgi?id=732460
vala/valagirparser.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 159ce9f..27548f4 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3795,8 +3795,8 @@ public class Vala.GirParser : CodeVisitor {
var cname = node.get_cname ();
Parameter first_param = null;
- if (method.get_parameters ().size > 0) {
- first_param = method.get_parameters()[0];
+ if (node.parameters.size > 0) {
+ first_param = node.parameters[0].param;
}
if (first_param != null && first_param.variable_type is UnresolvedType) {
// check if it's a missed instance method (often happens for structs)
@@ -3808,8 +3808,8 @@ public class Vala.GirParser : CodeVisitor {
if (parent.lookup (new_name) == null) {
ns.remove_member (node);
node.name = new_name;
+ node.parameters.remove_at (0);
method.name = new_name;
- method.get_parameters().remove_at (0);
method.binding = MemberBinding.INSTANCE;
parent.add_member (node);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]