]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
driver: 0.14: Add throws declaration to signatures
authorFlorian Brosch <flo.brosch@gmail.com>
Thu, 3 Nov 2011 01:49:51 +0000 (02:49 +0100)
committerFlorian Brosch <flo.brosch@gmail.com>
Thu, 3 Nov 2011 01:49:51 +0000 (02:49 +0100)
src/driver/0.14.x/symbolresolver.vala

index ad47b3b46fd7df6bb4aa7aa716b1f80d571cba4c..bd3163fc040ef00f87a86604d087efe6b92abe1c 100644 (file)
@@ -38,6 +38,14 @@ public class Valadoc.Drivers.SymbolResolver : Visitor {
                return symbol_map.get (symbol);
        }
 
+       private void resolve_thrown_list (Symbol symbol, Vala.List<Vala.DataType> types) {
+               foreach (Vala.DataType type in types) {
+                       Vala.ErrorDomain vala_edom = (Vala.ErrorDomain) type.data_type;
+                       Symbol? edom = symbol_map.get (vala_edom);
+                       symbol.add_child (edom ?? glib_error);
+               }
+       }
+
        private void resolve_array_type_references (Api.Array ptr) {
                Api.Item data_type = ptr.data_type;
                if (data_type == null) {
@@ -203,8 +211,12 @@ public class Valadoc.Drivers.SymbolResolver : Visitor {
         * {@inheritDoc}
         */
        public override void visit_delegate (Delegate item) {
+               Vala.Delegate vala_delegate = item.data as Vala.Delegate;
+
                resolve_type_reference (item.return_type);
 
+               resolve_thrown_list (item, vala_delegate.get_error_types ());
+
                item.accept_all_children (this, false);
        }
 
@@ -235,6 +247,8 @@ public class Valadoc.Drivers.SymbolResolver : Visitor {
                        item.base_method = (Method?) resolve (base_vala_method);
                }
 
+               resolve_thrown_list (item, vala_method.get_error_types ());
+
                resolve_type_reference (item.return_type);
 
                item.accept_all_children (this, false);