[gobject-introspection] scanner: Fix previous rename-to handling commit



commit 25d7a4dc44e3a9c211ac8f82925063e638c202c6
Author: Colin Walters <walters verbum org>
Date:   Fri Sep 3 18:09:35 2010 -0400

    scanner: Fix previous rename-to handling commit

 girepository/girparser.c                  |    2 +-
 giscanner/maintransformer.py              |   10 ++++++----
 tests/scanner/Annotation-1.0-expected.gir |    4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 0c022f9..53f1c41 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -818,7 +818,7 @@ start_function (GMarkupParseContext *context,
   ctx->in_embedded_type = in_embedded_type;
 
   name = find_attribute ("name", attribute_names, attribute_values);
-  shadows = find_attribute ("name", attribute_names, attribute_values);
+  shadows = find_attribute ("shadows", attribute_names, attribute_values);
   symbol = find_attribute ("c:identifier", attribute_names, attribute_values);
   deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
   throws = find_attribute ("throws", attribute_names, attribute_values);
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 3cb090b..dc09ae2 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -142,13 +142,12 @@ class MainTransformer(object):
                 target.shadows,
                 rename_to))
         else:
-            target.shadowed_by = node.symbol
-            node.shadows = target.symbol
+            target.shadowed_by = node.name
+            node.shadows = target.name
 
     def _apply_annotations_function(self, node, chain):
         block = self._blocks.get(node.symbol)
         self._apply_annotations_callable(node, chain, block)
-        self._apply_annotation_rename_to(node, chain, block)
 
     def _pass_callable_defaults(self, node, chain):
         if isinstance(node, (ast.Callable, glibast.GLibSignal)):
@@ -607,9 +606,12 @@ class MainTransformer(object):
         return True
 
     def _apply_annotations2_function(self, node, chain):
+        block = self._blocks.get(node.symbol)
+
+        self._apply_annotation_rename_to(node, chain, block)
+
         # Handle virtual invokers
         parent = chain[-1] if chain else None
-        block = self._blocks.get(node.symbol)
         if not (block and parent):
             return
         virtual = block.get(TAG_VFUNC)
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 3dcd0cb..6d72dd4 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -456,7 +456,7 @@ type.</doc>
       </method>
       <method name="watch"
               c:identifier="annotation_object_watch"
-              shadowed-by="annotation_object_watch_full"
+              shadowed-by="watch_full"
               introspectable="0">
         <doc xml:whitespace="preserve">This is here just for the sake of being overriden by its
 annotation_object_watch_full().</doc>
@@ -476,7 +476,7 @@ annotation_object_watch_full().</doc>
       </method>
       <method name="watch_full"
               c:identifier="annotation_object_watch_full"
-              shadows="annotation_object_watch">
+              shadows="watch">
         <doc xml:whitespace="preserve">Test overriding via the "Rename To" annotation.</doc>
         <return-value transfer-ownership="none">
           <type name="none" c:type="void"/>



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