/* symbolresolver.c generated by valac, the Vala compiler
 * generated from symbolresolver.vala, do not modify */

/* symbolresolver.vala
 *
 * Copyright (C) 2011  Florian Brosch
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Florian Brosch <flo.brosch@gmail.com>
 */

#include <valadoc.h>
#include <glib-object.h>
#include <valagee.h>
#include <vala.h>
#include <glib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define VALADOC_TYPE_SYMBOL_RESOLVER (valadoc_symbol_resolver_get_type ())
#define VALADOC_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolver))
#define VALADOC_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolverClass))
#define VALADOC_IS_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_TYPE_SYMBOL_RESOLVER))
#define VALADOC_IS_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_TYPE_SYMBOL_RESOLVER))
#define VALADOC_SYMBOL_RESOLVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolverClass))

typedef struct _ValadocSymbolResolver ValadocSymbolResolver;
typedef struct _ValadocSymbolResolverClass ValadocSymbolResolverClass;
typedef struct _ValadocSymbolResolverPrivate ValadocSymbolResolverPrivate;
enum  {
	VALADOC_SYMBOL_RESOLVER_0_PROPERTY,
	VALADOC_SYMBOL_RESOLVER_NUM_PROPERTIES
};
static GParamSpec* valadoc_symbol_resolver_properties[VALADOC_SYMBOL_RESOLVER_NUM_PROPERTIES];
#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_api_tree_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_tree_unref (var), NULL)))

#define VALADOC_TYPE_TREE_BUILDER (valadoc_tree_builder_get_type ())
#define VALADOC_TREE_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_TYPE_TREE_BUILDER, ValadocTreeBuilder))
#define VALADOC_TREE_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_TYPE_TREE_BUILDER, ValadocTreeBuilderClass))
#define VALADOC_IS_TREE_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_TYPE_TREE_BUILDER))
#define VALADOC_IS_TREE_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_TYPE_TREE_BUILDER))
#define VALADOC_TREE_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_TYPE_TREE_BUILDER, ValadocTreeBuilderClass))

typedef struct _ValadocTreeBuilder ValadocTreeBuilder;
typedef struct _ValadocTreeBuilderClass ValadocTreeBuilderClass;
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_iterator_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterator_unref (var), NULL)))

#define VALADOC_API_TYPE_INITIALIZER_BUILDER (valadoc_api_initializer_builder_get_type ())
#define VALADOC_API_INITIALIZER_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilder))
#define VALADOC_API_INITIALIZER_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilderClass))
#define VALADOC_API_IS_INITIALIZER_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER))
#define VALADOC_API_IS_INITIALIZER_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_API_TYPE_INITIALIZER_BUILDER))
#define VALADOC_API_INITIALIZER_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilderClass))

typedef struct _ValadocApiInitializerBuilder ValadocApiInitializerBuilder;
typedef struct _ValadocApiInitializerBuilderClass ValadocApiInitializerBuilderClass;
#define _vala_code_visitor_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_visitor_unref (var), NULL)))
#define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))

struct _ValadocSymbolResolver {
	ValadocApiVisitor parent_instance;
	ValadocSymbolResolverPrivate * priv;
};

struct _ValadocSymbolResolverClass {
	ValadocApiVisitorClass parent_class;
};

struct _ValadocSymbolResolverPrivate {
	ValaHashMap* symbol_map;
	ValadocApiClass* glib_error;
	ValadocApiTree* root;
};

static gint ValadocSymbolResolver_private_offset;
static gpointer valadoc_symbol_resolver_parent_class = NULL;

VALA_EXTERN GType valadoc_symbol_resolver_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValadocSymbolResolver, g_object_unref)
VALA_EXTERN GType valadoc_tree_builder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValadocTreeBuilder, vala_code_visitor_unref)
VALA_EXTERN ValadocSymbolResolver* valadoc_symbol_resolver_new (ValadocTreeBuilder* builder);
VALA_EXTERN ValadocSymbolResolver* valadoc_symbol_resolver_construct (GType object_type,
                                                          ValadocTreeBuilder* builder);
VALA_EXTERN ValaHashMap* valadoc_tree_builder_get_symbol_map (ValadocTreeBuilder* self);
VALA_EXTERN ValadocApiClass* valadoc_tree_builder_get_glib_error (ValadocTreeBuilder* self);
VALA_EXTERN ValadocApiSymbol* valadoc_symbol_resolver_resolve (ValadocSymbolResolver* self,
                                                   ValaSymbol* symbol);
static void valadoc_symbol_resolver_resolve_thrown_list (ValadocSymbolResolver* self,
                                                  ValadocApiSymbol* symbol,
                                                  ValaSymbol* vala_symbol);
static void valadoc_symbol_resolver_resolve_array_type_references (ValadocSymbolResolver* self,
                                                            ValadocApiArray* ptr);
static void valadoc_symbol_resolver_resolve_pointer_type_references (ValadocSymbolResolver* self,
                                                              ValadocApiPointer* ptr);
static void valadoc_symbol_resolver_resolve_type_reference (ValadocSymbolResolver* self,
                                                     ValadocApiTypeReference* reference);
static void valadoc_symbol_resolver_real_visit_tree (ValadocApiVisitor* base,
                                              ValadocApiTree* item);
static void valadoc_symbol_resolver_real_visit_package (ValadocApiVisitor* base,
                                                 ValadocApiPackage* item);
static void valadoc_symbol_resolver_real_visit_namespace (ValadocApiVisitor* base,
                                                   ValadocApiNamespace* item);
static void valadoc_symbol_resolver_real_visit_interface (ValadocApiVisitor* base,
                                                   ValadocApiInterface* item);
static void valadoc_symbol_resolver_real_visit_class (ValadocApiVisitor* base,
                                               ValadocApiClass* item);
static void valadoc_symbol_resolver_real_visit_struct (ValadocApiVisitor* base,
                                                ValadocApiStruct* item);
static void valadoc_symbol_resolver_real_visit_property (ValadocApiVisitor* base,
                                                  ValadocApiProperty* item);
static void valadoc_symbol_resolver_real_visit_field (ValadocApiVisitor* base,
                                               ValadocApiField* item);
static void valadoc_symbol_resolver_real_visit_constant (ValadocApiVisitor* base,
                                                  ValadocApiConstant* item);
static void valadoc_symbol_resolver_real_visit_delegate (ValadocApiVisitor* base,
                                                  ValadocApiDelegate* item);
static void valadoc_symbol_resolver_real_visit_signal (ValadocApiVisitor* base,
                                                ValadocApiSignal* item);
static void valadoc_symbol_resolver_real_visit_method (ValadocApiVisitor* base,
                                                ValadocApiMethod* item);
static void valadoc_symbol_resolver_real_visit_type_parameter (ValadocApiVisitor* base,
                                                        ValadocApiTypeParameter* item);
static void valadoc_symbol_resolver_real_visit_formal_parameter (ValadocApiVisitor* base,
                                                          ValadocApiParameter* item);
 G_GNUC_INTERNAL GType valadoc_api_initializer_builder_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ValadocApiInitializerBuilder, vala_code_visitor_unref)
 G_GNUC_INTERNAL ValadocApiInitializerBuilder* valadoc_api_initializer_builder_new (ValadocApiSignatureBuilder* signature,
                                                                   ValaHashMap* symbol_map);
 G_GNUC_INTERNAL ValadocApiInitializerBuilder* valadoc_api_initializer_builder_construct (GType object_type,
                                                                         ValadocApiSignatureBuilder* signature,
                                                                         ValaHashMap* symbol_map);
static void valadoc_symbol_resolver_real_visit_error_domain (ValadocApiVisitor* base,
                                                      ValadocApiErrorDomain* item);
static void valadoc_symbol_resolver_real_visit_error_code (ValadocApiVisitor* base,
                                                    ValadocApiErrorCode* item);
static void valadoc_symbol_resolver_real_visit_enum (ValadocApiVisitor* base,
                                              ValadocApiEnum* item);
static void valadoc_symbol_resolver_real_visit_enum_value (ValadocApiVisitor* base,
                                                    ValadocApiEnumValue* item);
static void valadoc_symbol_resolver_finalize (GObject * obj);
static GType valadoc_symbol_resolver_get_type_once (void);

static inline gpointer
valadoc_symbol_resolver_get_instance_private (ValadocSymbolResolver* self)
{
	return G_STRUCT_MEMBER_P (self, ValadocSymbolResolver_private_offset);
}

ValadocSymbolResolver*
valadoc_symbol_resolver_construct (GType object_type,
                                   ValadocTreeBuilder* builder)
{
	ValadocSymbolResolver * self = NULL;
	ValaHashMap* _tmp0_;
	ValadocApiClass* _tmp1_;
	g_return_val_if_fail (builder != NULL, NULL);
	self = (ValadocSymbolResolver*) valadoc_api_visitor_construct (object_type);
	_tmp0_ = valadoc_tree_builder_get_symbol_map (builder);
	_vala_map_unref0 (self->priv->symbol_map);
	self->priv->symbol_map = _tmp0_;
	_tmp1_ = valadoc_tree_builder_get_glib_error (builder);
	_g_object_unref0 (self->priv->glib_error);
	self->priv->glib_error = _tmp1_;
	return self;
}

ValadocSymbolResolver*
valadoc_symbol_resolver_new (ValadocTreeBuilder* builder)
{
	return valadoc_symbol_resolver_construct (VALADOC_TYPE_SYMBOL_RESOLVER, builder);
}

ValadocApiSymbol*
valadoc_symbol_resolver_resolve (ValadocSymbolResolver* self,
                                 ValaSymbol* symbol)
{
	ValaHashMap* _tmp0_;
	gpointer _tmp1_;
	ValadocApiSymbol* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	_tmp0_ = self->priv->symbol_map;
	_tmp1_ = vala_map_get ((ValaMap*) _tmp0_, symbol);
	result = (ValadocApiSymbol*) _tmp1_;
	return result;
}

static void
valadoc_symbol_resolver_resolve_thrown_list (ValadocSymbolResolver* self,
                                             ValadocApiSymbol* symbol,
                                             ValaSymbol* vala_symbol)
{
	ValaArrayList* error_types = NULL;
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	ValaArrayList* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (symbol != NULL);
	g_return_if_fail (vala_symbol != NULL);
	_tmp0_ = g_direct_equal;
	_tmp1_ = vala_array_list_new (VALA_TYPE_DATA_TYPE, (GBoxedCopyFunc) vala_code_node_ref, (GDestroyNotify) vala_code_node_unref, _tmp0_);
	error_types = _tmp1_;
	_tmp2_ = error_types;
	vala_code_node_get_error_types ((ValaCodeNode*) vala_symbol, (ValaCollection*) _tmp2_, NULL);
	{
		ValaArrayList* _type_list = NULL;
		ValaArrayList* _tmp3_;
		gint _type_size = 0;
		ValaArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _type_index = 0;
		_tmp3_ = error_types;
		_type_list = _tmp3_;
		_tmp4_ = _type_list;
		_tmp5_ = vala_collection_get_size ((ValaCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_type_size = _tmp6_;
		_type_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			ValaDataType* type = NULL;
			ValaArrayList* _tmp9_;
			gpointer _tmp10_;
			ValaErrorDomain* vala_edom = NULL;
			ValaDataType* _tmp11_;
			ValaErrorDomain* _tmp12_;
			ValaErrorDomain* _tmp13_;
			ValadocApiSymbol* edom = NULL;
			ValaHashMap* _tmp14_;
			ValaErrorDomain* _tmp15_;
			gpointer _tmp16_;
			ValadocApiSymbol* _tmp17_ = NULL;
			ValadocApiSymbol* _tmp18_;
			_type_index = _type_index + 1;
			_tmp7_ = _type_index;
			_tmp8_ = _type_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _type_list;
			_tmp10_ = vala_list_get ((ValaList*) _tmp9_, _type_index);
			type = (ValaDataType*) _tmp10_;
			_tmp11_ = type;
			_tmp12_ = vala_error_type_get_error_domain (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALA_TYPE_ERROR_TYPE, ValaErrorType));
			_tmp13_ = _tmp12_;
			vala_edom = _tmp13_;
			_tmp14_ = self->priv->symbol_map;
			_tmp15_ = vala_edom;
			_tmp16_ = vala_map_get ((ValaMap*) _tmp14_, (ValaSymbol*) _tmp15_);
			edom = (ValadocApiSymbol*) _tmp16_;
			_tmp18_ = edom;
			_tmp17_ = _tmp18_;
			if (_tmp17_ == NULL) {
				ValadocApiClass* _tmp19_;
				_tmp19_ = self->priv->glib_error;
				_tmp17_ = (ValadocApiSymbol*) _tmp19_;
			}
			valadoc_api_node_add_child ((ValadocApiNode*) symbol, _tmp17_);
			_g_object_unref0 (edom);
			_vala_code_node_unref0 (type);
		}
	}
	_vala_iterable_unref0 (error_types);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
valadoc_symbol_resolver_resolve_array_type_references (ValadocSymbolResolver* self,
                                                       ValadocApiArray* ptr)
{
	ValadocApiItem* data_type = NULL;
	ValadocApiItem* _tmp0_;
	ValadocApiItem* _tmp1_;
	ValadocApiItem* _tmp2_;
	ValadocApiItem* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ptr != NULL);
	_tmp0_ = valadoc_api_array_get_data_type (ptr);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	data_type = _tmp2_;
	_tmp3_ = data_type;
	if (_tmp3_ == NULL) {
	} else {
		ValadocApiItem* _tmp4_;
		_tmp4_ = data_type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiItem* _tmp5_;
			_tmp5_ = data_type;
			valadoc_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		} else {
			ValadocApiItem* _tmp6_;
			_tmp6_ = data_type;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, VALADOC_API_TYPE_POINTER)) {
				ValadocApiItem* _tmp7_;
				_tmp7_ = data_type;
				valadoc_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
			} else {
				ValadocApiItem* _tmp8_;
				_tmp8_ = data_type;
				valadoc_symbol_resolver_resolve_type_reference (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference));
			}
		}
	}
	_g_object_unref0 (data_type);
}

static void
valadoc_symbol_resolver_resolve_pointer_type_references (ValadocSymbolResolver* self,
                                                         ValadocApiPointer* ptr)
{
	ValadocApiItem* type = NULL;
	ValadocApiItem* _tmp0_;
	ValadocApiItem* _tmp1_;
	ValadocApiItem* _tmp2_;
	ValadocApiItem* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ptr != NULL);
	_tmp0_ = valadoc_api_pointer_get_data_type (ptr);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	type = _tmp2_;
	_tmp3_ = type;
	if (_tmp3_ == NULL) {
	} else {
		ValadocApiItem* _tmp4_;
		_tmp4_ = type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiItem* _tmp5_;
			_tmp5_ = type;
			valadoc_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		} else {
			ValadocApiItem* _tmp6_;
			_tmp6_ = type;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, VALADOC_API_TYPE_POINTER)) {
				ValadocApiItem* _tmp7_;
				_tmp7_ = type;
				valadoc_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
			} else {
				ValadocApiItem* _tmp8_;
				_tmp8_ = type;
				valadoc_symbol_resolver_resolve_type_reference (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference));
			}
		}
	}
	_g_object_unref0 (type);
}

static gpointer
_vala_code_node_ref0 (gpointer self)
{
	return self ? vala_code_node_ref (self) : NULL;
}

static void
valadoc_symbol_resolver_resolve_type_reference (ValadocSymbolResolver* self,
                                                ValadocApiTypeReference* reference)
{
	ValaDataType* vtyperef = NULL;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	ValaDataType* _tmp2_;
	ValaDataType* _tmp3_;
	ValadocApiItem* _tmp41_;
	ValadocApiItem* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reference != NULL);
	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) reference);
	_tmp1_ = _tmp0_;
	_tmp2_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_DATA_TYPE, ValaDataType));
	vtyperef = _tmp2_;
	_tmp3_ = vtyperef;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, VALA_TYPE_ERROR_TYPE)) {
		ValaErrorDomain* verrdom = NULL;
		ValaDataType* _tmp4_;
		ValaErrorDomain* _tmp5_;
		ValaErrorDomain* _tmp6_;
		ValaErrorDomain* _tmp7_;
		ValaErrorDomain* _tmp8_;
		_tmp4_ = vtyperef;
		_tmp5_ = vala_error_type_get_error_domain (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, VALA_TYPE_ERROR_TYPE, ValaErrorType));
		_tmp6_ = _tmp5_;
		_tmp7_ = _vala_code_node_ref0 (_tmp6_);
		verrdom = _tmp7_;
		_tmp8_ = verrdom;
		if (_tmp8_ != NULL) {
			ValaErrorDomain* _tmp9_;
			ValadocApiSymbol* _tmp10_;
			ValadocApiSymbol* _tmp11_;
			_tmp9_ = verrdom;
			_tmp10_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp9_);
			_tmp11_ = _tmp10_;
			valadoc_api_typereference_set_data_type (reference, (ValadocApiItem*) _tmp11_);
			_g_object_unref0 (_tmp11_);
		} else {
			ValadocApiClass* _tmp12_;
			_tmp12_ = self->priv->glib_error;
			valadoc_api_typereference_set_data_type (reference, (ValadocApiItem*) _tmp12_);
		}
		_vala_code_node_unref0 (verrdom);
	} else {
		ValaDataType* _tmp13_;
		_tmp13_ = vtyperef;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, VALA_TYPE_DELEGATE_TYPE)) {
			ValaDataType* _tmp14_;
			ValaDelegate* _tmp15_;
			ValaDelegate* _tmp16_;
			ValadocApiSymbol* _tmp17_;
			ValadocApiSymbol* _tmp18_;
			_tmp14_ = vtyperef;
			_tmp15_ = vala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType));
			_tmp16_ = _tmp15_;
			_tmp17_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp16_);
			_tmp18_ = _tmp17_;
			valadoc_api_typereference_set_data_type (reference, (ValadocApiItem*) _tmp18_);
			_g_object_unref0 (_tmp18_);
		} else {
			ValaDataType* _tmp19_;
			_tmp19_ = vtyperef;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, VALA_TYPE_GENERIC_TYPE)) {
				ValaDataType* _tmp20_;
				ValaTypeParameter* _tmp21_;
				ValaTypeParameter* _tmp22_;
				ValadocApiSymbol* _tmp23_;
				ValadocApiSymbol* _tmp24_;
				_tmp20_ = vtyperef;
				_tmp21_ = vala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, VALA_TYPE_GENERIC_TYPE, ValaGenericType));
				_tmp22_ = _tmp21_;
				_tmp23_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp22_);
				_tmp24_ = _tmp23_;
				valadoc_api_typereference_set_data_type (reference, (ValadocApiItem*) _tmp24_);
				_g_object_unref0 (_tmp24_);
			} else {
				ValaDataType* _tmp25_;
				ValaTypeSymbol* _tmp26_;
				ValaTypeSymbol* _tmp27_;
				_tmp25_ = vtyperef;
				_tmp26_ = vala_data_type_get_type_symbol (_tmp25_);
				_tmp27_ = _tmp26_;
				if (_tmp27_ != NULL) {
					ValaDataType* _tmp28_;
					ValaTypeSymbol* _tmp29_;
					ValaTypeSymbol* _tmp30_;
					ValadocApiSymbol* _tmp31_;
					ValadocApiSymbol* _tmp32_;
					_tmp28_ = vtyperef;
					_tmp29_ = vala_data_type_get_type_symbol (_tmp28_);
					_tmp30_ = _tmp29_;
					_tmp31_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp30_);
					_tmp32_ = _tmp31_;
					valadoc_api_typereference_set_data_type (reference, (ValadocApiItem*) _tmp32_);
					_g_object_unref0 (_tmp32_);
				}
			}
		}
	}
	{
		ValaIterator* _type_param_ref_it = NULL;
		ValaCollection* _tmp33_;
		ValaCollection* _tmp34_;
		ValaIterator* _tmp35_;
		ValaIterator* _tmp36_;
		_tmp33_ = valadoc_api_typereference_get_type_arguments (reference);
		_tmp34_ = _tmp33_;
		_tmp35_ = vala_iterable_iterator ((ValaIterable*) _tmp34_);
		_tmp36_ = _tmp35_;
		_vala_iterable_unref0 (_tmp34_);
		_type_param_ref_it = _tmp36_;
		while (TRUE) {
			ValaIterator* _tmp37_;
			ValadocApiTypeReference* type_param_ref = NULL;
			ValaIterator* _tmp38_;
			gpointer _tmp39_;
			ValadocApiTypeReference* _tmp40_;
			_tmp37_ = _type_param_ref_it;
			if (!vala_iterator_next (_tmp37_)) {
				break;
			}
			_tmp38_ = _type_param_ref_it;
			_tmp39_ = vala_iterator_get (_tmp38_);
			type_param_ref = (ValadocApiTypeReference*) _tmp39_;
			_tmp40_ = type_param_ref;
			valadoc_symbol_resolver_resolve_type_reference (self, _tmp40_);
			_g_object_unref0 (type_param_ref);
		}
		_vala_iterator_unref0 (_type_param_ref_it);
	}
	_tmp41_ = valadoc_api_typereference_get_data_type (reference);
	_tmp42_ = _tmp41_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, VALADOC_API_TYPE_POINTER)) {
		ValadocApiItem* _tmp43_;
		ValadocApiItem* _tmp44_;
		_tmp43_ = valadoc_api_typereference_get_data_type (reference);
		_tmp44_ = _tmp43_;
		valadoc_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
	} else {
		ValadocApiItem* _tmp45_;
		ValadocApiItem* _tmp46_;
		_tmp45_ = valadoc_api_typereference_get_data_type (reference);
		_tmp46_ = _tmp45_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiItem* _tmp47_;
			ValadocApiItem* _tmp48_;
			_tmp47_ = valadoc_api_typereference_get_data_type (reference);
			_tmp48_ = _tmp47_;
			valadoc_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		}
	}
	_vala_code_node_unref0 (vtyperef);
}

/**
 * {@inheritDoc}
 */
static gpointer
_valadoc_api_tree_ref0 (gpointer self)
{
	return self ? valadoc_api_tree_ref (self) : NULL;
}

static void
valadoc_symbol_resolver_real_visit_tree (ValadocApiVisitor* base,
                                         ValadocApiTree* item)
{
	ValadocSymbolResolver * self;
	ValadocApiTree* _tmp0_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = _valadoc_api_tree_ref0 (item);
	_valadoc_api_tree_unref0 (self->priv->root);
	self->priv->root = _tmp0_;
	valadoc_api_tree_accept_children (item, (ValadocApiVisitor*) self);
	_valadoc_api_tree_unref0 (self->priv->root);
	self->priv->root = NULL;
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_package (ValadocApiVisitor* base,
                                            ValadocApiPackage* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_namespace (ValadocApiVisitor* base,
                                              ValadocApiNamespace* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_interface (ValadocApiVisitor* base,
                                              ValadocApiInterface* item)
{
	ValadocSymbolResolver * self;
	ValaCollection* interfaces = NULL;
	ValaCollection* _tmp0_;
	ValadocApiTypeReference* _tmp7_;
	ValadocApiTypeReference* _tmp8_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_interface_get_implemented_interface_list (item);
	interfaces = _tmp0_;
	{
		ValaIterator* _type_ref_it = NULL;
		ValaCollection* _tmp1_;
		ValaIterator* _tmp2_;
		_tmp1_ = interfaces;
		_tmp2_ = vala_iterable_iterator ((ValaIterable*) _tmp1_);
		_type_ref_it = _tmp2_;
		while (TRUE) {
			ValaIterator* _tmp3_;
			ValadocApiTypeReference* type_ref = NULL;
			ValaIterator* _tmp4_;
			gpointer _tmp5_;
			ValadocApiTypeReference* _tmp6_;
			_tmp3_ = _type_ref_it;
			if (!vala_iterator_next (_tmp3_)) {
				break;
			}
			_tmp4_ = _type_ref_it;
			_tmp5_ = vala_iterator_get (_tmp4_);
			type_ref = (ValadocApiTypeReference*) _tmp5_;
			_tmp6_ = type_ref;
			valadoc_symbol_resolver_resolve_type_reference (self, _tmp6_);
			_g_object_unref0 (type_ref);
		}
		_vala_iterator_unref0 (_type_ref_it);
	}
	_tmp7_ = valadoc_api_interface_get_base_type (item);
	_tmp8_ = _tmp7_;
	if (_tmp8_ != NULL) {
		ValadocApiTypeReference* _tmp9_;
		ValadocApiTypeReference* _tmp10_;
		_tmp9_ = valadoc_api_interface_get_base_type (item);
		_tmp10_ = _tmp9_;
		valadoc_symbol_resolver_resolve_type_reference (self, _tmp10_);
	}
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
	_vala_iterable_unref0 (interfaces);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_class (ValadocApiVisitor* base,
                                          ValadocApiClass* item)
{
	ValadocSymbolResolver * self;
	ValaCollection* interfaces = NULL;
	ValaCollection* _tmp0_;
	ValadocApiTypeReference* _tmp7_;
	ValadocApiTypeReference* _tmp8_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_class_get_implemented_interface_list (item);
	interfaces = _tmp0_;
	{
		ValaIterator* _type_ref_it = NULL;
		ValaCollection* _tmp1_;
		ValaIterator* _tmp2_;
		_tmp1_ = interfaces;
		_tmp2_ = vala_iterable_iterator ((ValaIterable*) _tmp1_);
		_type_ref_it = _tmp2_;
		while (TRUE) {
			ValaIterator* _tmp3_;
			ValadocApiTypeReference* type_ref = NULL;
			ValaIterator* _tmp4_;
			gpointer _tmp5_;
			ValadocApiTypeReference* _tmp6_;
			_tmp3_ = _type_ref_it;
			if (!vala_iterator_next (_tmp3_)) {
				break;
			}
			_tmp4_ = _type_ref_it;
			_tmp5_ = vala_iterator_get (_tmp4_);
			type_ref = (ValadocApiTypeReference*) _tmp5_;
			_tmp6_ = type_ref;
			valadoc_symbol_resolver_resolve_type_reference (self, _tmp6_);
			_g_object_unref0 (type_ref);
		}
		_vala_iterator_unref0 (_type_ref_it);
	}
	_tmp7_ = valadoc_api_class_get_base_type (item);
	_tmp8_ = _tmp7_;
	if (_tmp8_ != NULL) {
		ValadocApiTypeReference* _tmp9_;
		ValadocApiTypeReference* _tmp10_;
		_tmp9_ = valadoc_api_class_get_base_type (item);
		_tmp10_ = _tmp9_;
		valadoc_symbol_resolver_resolve_type_reference (self, _tmp10_);
	}
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
	_vala_iterable_unref0 (interfaces);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_struct (ValadocApiVisitor* base,
                                           ValadocApiStruct* item)
{
	ValadocSymbolResolver * self;
	ValadocApiTypeReference* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_struct_get_base_type (item);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ValadocApiTypeReference* _tmp2_;
		ValadocApiTypeReference* _tmp3_;
		_tmp2_ = valadoc_api_struct_get_base_type (item);
		_tmp3_ = _tmp2_;
		valadoc_symbol_resolver_resolve_type_reference (self, _tmp3_);
	}
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_property (ValadocApiVisitor* base,
                                             ValadocApiProperty* item)
{
	ValadocSymbolResolver * self;
	ValaProperty* vala_property = NULL;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	ValaProperty* _tmp2_;
	ValaProperty* base_vala_property = NULL;
	ValaProperty* _tmp3_;
	ValaProperty* _tmp4_;
	ValaProperty* _tmp5_;
	gboolean _tmp17_ = FALSE;
	ValaProperty* _tmp18_;
	ValaProperty* _tmp19_;
	ValaProperty* _tmp27_;
	ValadocApiTypeReference* _tmp31_;
	ValadocApiTypeReference* _tmp32_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_PROPERTY) ? ((ValaProperty*) _tmp1_) : NULL);
	vala_property = _tmp2_;
	base_vala_property = NULL;
	_tmp3_ = vala_property;
	_tmp4_ = vala_property_get_base_property (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		ValaProperty* _tmp6_;
		ValaProperty* _tmp7_;
		ValaProperty* _tmp8_;
		ValaProperty* _tmp9_;
		_tmp6_ = vala_property;
		_tmp7_ = vala_property_get_base_property (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _vala_code_node_ref0 (_tmp8_);
		_vala_code_node_unref0 (base_vala_property);
		base_vala_property = _tmp9_;
	} else {
		ValaProperty* _tmp10_;
		ValaProperty* _tmp11_;
		ValaProperty* _tmp12_;
		_tmp10_ = vala_property;
		_tmp11_ = vala_property_get_base_interface_property (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ != NULL) {
			ValaProperty* _tmp13_;
			ValaProperty* _tmp14_;
			ValaProperty* _tmp15_;
			ValaProperty* _tmp16_;
			_tmp13_ = vala_property;
			_tmp14_ = vala_property_get_base_interface_property (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _vala_code_node_ref0 (_tmp15_);
			_vala_code_node_unref0 (base_vala_property);
			base_vala_property = _tmp16_;
		}
	}
	_tmp18_ = base_vala_property;
	_tmp19_ = vala_property;
	if (_tmp18_ == _tmp19_) {
		ValaProperty* _tmp20_;
		ValaProperty* _tmp21_;
		ValaProperty* _tmp22_;
		_tmp20_ = vala_property;
		_tmp21_ = vala_property_get_base_interface_property (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp17_ = _tmp22_ != NULL;
	} else {
		_tmp17_ = FALSE;
	}
	if (_tmp17_) {
		ValaProperty* _tmp23_;
		ValaProperty* _tmp24_;
		ValaProperty* _tmp25_;
		ValaProperty* _tmp26_;
		_tmp23_ = vala_property;
		_tmp24_ = vala_property_get_base_interface_property (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = _vala_code_node_ref0 (_tmp25_);
		_vala_code_node_unref0 (base_vala_property);
		base_vala_property = _tmp26_;
	}
	_tmp27_ = base_vala_property;
	if (_tmp27_ != NULL) {
		ValaProperty* _tmp28_;
		ValadocApiSymbol* _tmp29_;
		ValadocApiProperty* _tmp30_;
		_tmp28_ = base_vala_property;
		_tmp29_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp28_);
		_tmp30_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, VALADOC_API_TYPE_PROPERTY, ValadocApiProperty);
		valadoc_api_property_set_base_property (item, _tmp30_);
		_g_object_unref0 (_tmp30_);
	}
	_tmp31_ = valadoc_api_property_get_property_type (item);
	_tmp32_ = _tmp31_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp32_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (base_vala_property);
	_vala_code_node_unref0 (vala_property);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_field (ValadocApiVisitor* base,
                                          ValadocApiField* item)
{
	ValadocSymbolResolver * self;
	ValadocApiTypeReference* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_field_get_field_type (item);
	_tmp1_ = _tmp0_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp1_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_constant (ValadocApiVisitor* base,
                                             ValadocApiConstant* item)
{
	ValadocSymbolResolver * self;
	ValadocApiTypeReference* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_constant_get_constant_type (item);
	_tmp1_ = _tmp0_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp1_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_delegate (ValadocApiVisitor* base,
                                             ValadocApiDelegate* item)
{
	ValadocSymbolResolver * self;
	ValaDelegate* vala_delegate = NULL;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	ValaDelegate* _tmp2_;
	ValadocApiTypeReference* _tmp3_;
	ValadocApiTypeReference* _tmp4_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_DELEGATE) ? ((ValaDelegate*) _tmp1_) : NULL);
	vala_delegate = _tmp2_;
	_tmp3_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) item);
	_tmp4_ = _tmp3_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp4_);
	valadoc_symbol_resolver_resolve_thrown_list (self, (ValadocApiSymbol*) item, (ValaSymbol*) vala_delegate);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (vala_delegate);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_signal (ValadocApiVisitor* base,
                                           ValadocApiSignal* item)
{
	ValadocSymbolResolver * self;
	ValadocApiTypeReference* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) item);
	_tmp1_ = _tmp0_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp1_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_method (ValadocApiVisitor* base,
                                           ValadocApiMethod* item)
{
	ValadocSymbolResolver * self;
	ValaMethod* vala_method = NULL;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	ValaMethod* _tmp2_;
	ValaMethod* base_vala_method = NULL;
	ValaMethod* _tmp3_;
	ValaMethod* _tmp4_;
	ValaMethod* _tmp5_;
	gboolean _tmp17_ = FALSE;
	ValaMethod* _tmp18_;
	ValaMethod* _tmp19_;
	ValaMethod* _tmp27_;
	ValaMethod* _tmp31_;
	ValadocApiTypeReference* _tmp32_;
	ValadocApiTypeReference* _tmp33_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_METHOD) ? ((ValaMethod*) _tmp1_) : NULL);
	vala_method = _tmp2_;
	base_vala_method = NULL;
	_tmp3_ = vala_method;
	_tmp4_ = vala_method_get_base_method (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		ValaMethod* _tmp6_;
		ValaMethod* _tmp7_;
		ValaMethod* _tmp8_;
		ValaMethod* _tmp9_;
		_tmp6_ = vala_method;
		_tmp7_ = vala_method_get_base_method (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _vala_code_node_ref0 (_tmp8_);
		_vala_code_node_unref0 (base_vala_method);
		base_vala_method = _tmp9_;
	} else {
		ValaMethod* _tmp10_;
		ValaMethod* _tmp11_;
		ValaMethod* _tmp12_;
		_tmp10_ = vala_method;
		_tmp11_ = vala_method_get_base_interface_method (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ != NULL) {
			ValaMethod* _tmp13_;
			ValaMethod* _tmp14_;
			ValaMethod* _tmp15_;
			ValaMethod* _tmp16_;
			_tmp13_ = vala_method;
			_tmp14_ = vala_method_get_base_interface_method (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _vala_code_node_ref0 (_tmp15_);
			_vala_code_node_unref0 (base_vala_method);
			base_vala_method = _tmp16_;
		}
	}
	_tmp18_ = base_vala_method;
	_tmp19_ = vala_method;
	if (_tmp18_ == _tmp19_) {
		ValaMethod* _tmp20_;
		ValaMethod* _tmp21_;
		ValaMethod* _tmp22_;
		_tmp20_ = vala_method;
		_tmp21_ = vala_method_get_base_interface_method (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp17_ = _tmp22_ != NULL;
	} else {
		_tmp17_ = FALSE;
	}
	if (_tmp17_) {
		ValaMethod* _tmp23_;
		ValaMethod* _tmp24_;
		ValaMethod* _tmp25_;
		ValaMethod* _tmp26_;
		_tmp23_ = vala_method;
		_tmp24_ = vala_method_get_base_interface_method (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = _vala_code_node_ref0 (_tmp25_);
		_vala_code_node_unref0 (base_vala_method);
		base_vala_method = _tmp26_;
	}
	_tmp27_ = base_vala_method;
	if (_tmp27_ != NULL) {
		ValaMethod* _tmp28_;
		ValadocApiSymbol* _tmp29_;
		ValadocApiMethod* _tmp30_;
		_tmp28_ = base_vala_method;
		_tmp29_ = valadoc_symbol_resolver_resolve (self, (ValaSymbol*) _tmp28_);
		_tmp30_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, VALADOC_API_TYPE_METHOD, ValadocApiMethod);
		valadoc_api_method_set_base_method (item, _tmp30_);
		_g_object_unref0 (_tmp30_);
	}
	_tmp31_ = vala_method;
	valadoc_symbol_resolver_resolve_thrown_list (self, (ValadocApiSymbol*) item, (ValaSymbol*) _tmp31_);
	_tmp32_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) item);
	_tmp33_ = _tmp32_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp33_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (base_vala_method);
	_vala_code_node_unref0 (vala_method);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_type_parameter (ValadocApiVisitor* base,
                                                   ValadocApiTypeParameter* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_formal_parameter (ValadocApiVisitor* base,
                                                     ValadocApiParameter* item)
{
	ValadocSymbolResolver * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaCodeNode* _tmp2_;
	ValaCodeNode* _tmp3_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValadocApiTypeReference* _tmp18_;
	ValadocApiTypeReference* _tmp19_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_parameter_get_ellipsis (item);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		return;
	}
	_tmp2_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
	_tmp3_ = _tmp2_;
	_tmp4_ = vala_variable_get_initializer ((ValaVariable*) G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALA_TYPE_PARAMETER, ValaParameter));
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		ValadocApiSignatureBuilder* signature = NULL;
		ValadocApiSignatureBuilder* _tmp6_;
		ValadocApiInitializerBuilder* ibuilder = NULL;
		ValadocApiSignatureBuilder* _tmp7_;
		ValaHashMap* _tmp8_;
		ValadocApiInitializerBuilder* _tmp9_;
		ValaCodeNode* _tmp10_;
		ValaCodeNode* _tmp11_;
		ValaExpression* _tmp12_;
		ValaExpression* _tmp13_;
		ValadocApiInitializerBuilder* _tmp14_;
		ValadocApiSignatureBuilder* _tmp15_;
		ValadocContentRun* _tmp16_;
		ValadocContentRun* _tmp17_;
		_tmp6_ = valadoc_api_signature_builder_new ();
		signature = _tmp6_;
		_tmp7_ = signature;
		_tmp8_ = self->priv->symbol_map;
		_tmp9_ = valadoc_api_initializer_builder_new (_tmp7_, _tmp8_);
		ibuilder = _tmp9_;
		_tmp10_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
		_tmp11_ = _tmp10_;
		_tmp12_ = vala_variable_get_initializer ((ValaVariable*) G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALA_TYPE_PARAMETER, ValaParameter));
		_tmp13_ = _tmp12_;
		_tmp14_ = ibuilder;
		vala_code_node_accept ((ValaCodeNode*) _tmp13_, (ValaCodeVisitor*) _tmp14_);
		_tmp15_ = signature;
		_tmp16_ = valadoc_api_signature_builder_get (_tmp15_);
		_tmp17_ = _tmp16_;
		valadoc_api_parameter_set_default_value (item, _tmp17_);
		_g_object_unref0 (_tmp17_);
		_vala_code_visitor_unref0 (ibuilder);
		_valadoc_api_signature_builder_unref0 (signature);
	}
	_tmp18_ = valadoc_api_parameter_get_parameter_type (item);
	_tmp19_ = _tmp18_;
	valadoc_symbol_resolver_resolve_type_reference (self, _tmp19_);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_error_domain (ValadocApiVisitor* base,
                                                 ValadocApiErrorDomain* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_error_code (ValadocApiVisitor* base,
                                               ValadocApiErrorCode* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_enum (ValadocApiVisitor* base,
                                         ValadocApiEnum* item)
{
	ValadocSymbolResolver * self;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

/**
 * {@inheritDoc}
 */
static void
valadoc_symbol_resolver_real_visit_enum_value (ValadocApiVisitor* base,
                                               ValadocApiEnumValue* item)
{
	ValadocSymbolResolver * self;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	ValaExpression* _tmp2_;
	ValaExpression* _tmp3_;
	self = (ValadocSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_constant_get_value ((ValaConstant*) G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_ENUM_VALUE, ValaEnumValue));
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		ValadocApiSignatureBuilder* signature = NULL;
		ValadocApiSignatureBuilder* _tmp4_;
		ValadocApiInitializerBuilder* ibuilder = NULL;
		ValadocApiSignatureBuilder* _tmp5_;
		ValaHashMap* _tmp6_;
		ValadocApiInitializerBuilder* _tmp7_;
		ValaCodeNode* _tmp8_;
		ValaCodeNode* _tmp9_;
		ValaExpression* _tmp10_;
		ValaExpression* _tmp11_;
		ValadocApiInitializerBuilder* _tmp12_;
		ValadocApiSignatureBuilder* _tmp13_;
		ValadocContentRun* _tmp14_;
		ValadocContentRun* _tmp15_;
		_tmp4_ = valadoc_api_signature_builder_new ();
		signature = _tmp4_;
		_tmp5_ = signature;
		_tmp6_ = self->priv->symbol_map;
		_tmp7_ = valadoc_api_initializer_builder_new (_tmp5_, _tmp6_);
		ibuilder = _tmp7_;
		_tmp8_ = valadoc_api_item_get_data ((ValadocApiItem*) item);
		_tmp9_ = _tmp8_;
		_tmp10_ = vala_constant_get_value ((ValaConstant*) G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALA_TYPE_ENUM_VALUE, ValaEnumValue));
		_tmp11_ = _tmp10_;
		_tmp12_ = ibuilder;
		vala_code_node_accept ((ValaCodeNode*) _tmp11_, (ValaCodeVisitor*) _tmp12_);
		_tmp13_ = signature;
		_tmp14_ = valadoc_api_signature_builder_get (_tmp13_);
		_tmp15_ = _tmp14_;
		valadoc_api_enum_value_set_default_value (item, _tmp15_);
		_g_object_unref0 (_tmp15_);
		_vala_code_visitor_unref0 (ibuilder);
		_valadoc_api_signature_builder_unref0 (signature);
	}
	valadoc_api_node_accept_all_children ((ValadocApiNode*) item, (ValadocApiVisitor*) self, FALSE);
}

static void
valadoc_symbol_resolver_class_init (ValadocSymbolResolverClass * klass,
                                    gpointer klass_data)
{
	valadoc_symbol_resolver_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ValadocSymbolResolver_private_offset);
	((ValadocApiVisitorClass *) klass)->visit_tree = (void (*) (ValadocApiVisitor*, ValadocApiTree*)) valadoc_symbol_resolver_real_visit_tree;
	((ValadocApiVisitorClass *) klass)->visit_package = (void (*) (ValadocApiVisitor*, ValadocApiPackage*)) valadoc_symbol_resolver_real_visit_package;
	((ValadocApiVisitorClass *) klass)->visit_namespace = (void (*) (ValadocApiVisitor*, ValadocApiNamespace*)) valadoc_symbol_resolver_real_visit_namespace;
	((ValadocApiVisitorClass *) klass)->visit_interface = (void (*) (ValadocApiVisitor*, ValadocApiInterface*)) valadoc_symbol_resolver_real_visit_interface;
	((ValadocApiVisitorClass *) klass)->visit_class = (void (*) (ValadocApiVisitor*, ValadocApiClass*)) valadoc_symbol_resolver_real_visit_class;
	((ValadocApiVisitorClass *) klass)->visit_struct = (void (*) (ValadocApiVisitor*, ValadocApiStruct*)) valadoc_symbol_resolver_real_visit_struct;
	((ValadocApiVisitorClass *) klass)->visit_property = (void (*) (ValadocApiVisitor*, ValadocApiProperty*)) valadoc_symbol_resolver_real_visit_property;
	((ValadocApiVisitorClass *) klass)->visit_field = (void (*) (ValadocApiVisitor*, ValadocApiField*)) valadoc_symbol_resolver_real_visit_field;
	((ValadocApiVisitorClass *) klass)->visit_constant = (void (*) (ValadocApiVisitor*, ValadocApiConstant*)) valadoc_symbol_resolver_real_visit_constant;
	((ValadocApiVisitorClass *) klass)->visit_delegate = (void (*) (ValadocApiVisitor*, ValadocApiDelegate*)) valadoc_symbol_resolver_real_visit_delegate;
	((ValadocApiVisitorClass *) klass)->visit_signal = (void (*) (ValadocApiVisitor*, ValadocApiSignal*)) valadoc_symbol_resolver_real_visit_signal;
	((ValadocApiVisitorClass *) klass)->visit_method = (void (*) (ValadocApiVisitor*, ValadocApiMethod*)) valadoc_symbol_resolver_real_visit_method;
	((ValadocApiVisitorClass *) klass)->visit_type_parameter = (void (*) (ValadocApiVisitor*, ValadocApiTypeParameter*)) valadoc_symbol_resolver_real_visit_type_parameter;
	((ValadocApiVisitorClass *) klass)->visit_formal_parameter = (void (*) (ValadocApiVisitor*, ValadocApiParameter*)) valadoc_symbol_resolver_real_visit_formal_parameter;
	((ValadocApiVisitorClass *) klass)->visit_error_domain = (void (*) (ValadocApiVisitor*, ValadocApiErrorDomain*)) valadoc_symbol_resolver_real_visit_error_domain;
	((ValadocApiVisitorClass *) klass)->visit_error_code = (void (*) (ValadocApiVisitor*, ValadocApiErrorCode*)) valadoc_symbol_resolver_real_visit_error_code;
	((ValadocApiVisitorClass *) klass)->visit_enum = (void (*) (ValadocApiVisitor*, ValadocApiEnum*)) valadoc_symbol_resolver_real_visit_enum;
	((ValadocApiVisitorClass *) klass)->visit_enum_value = (void (*) (ValadocApiVisitor*, ValadocApiEnumValue*)) valadoc_symbol_resolver_real_visit_enum_value;
	G_OBJECT_CLASS (klass)->finalize = valadoc_symbol_resolver_finalize;
}

static void
valadoc_symbol_resolver_instance_init (ValadocSymbolResolver * self,
                                       gpointer klass)
{
	self->priv = valadoc_symbol_resolver_get_instance_private (self);
}

static void
valadoc_symbol_resolver_finalize (GObject * obj)
{
	ValadocSymbolResolver * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TYPE_SYMBOL_RESOLVER, ValadocSymbolResolver);
	_vala_map_unref0 (self->priv->symbol_map);
	_g_object_unref0 (self->priv->glib_error);
	_valadoc_api_tree_unref0 (self->priv->root);
	G_OBJECT_CLASS (valadoc_symbol_resolver_parent_class)->finalize (obj);
}

static GType
valadoc_symbol_resolver_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocSymbolResolverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_symbol_resolver_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocSymbolResolver), 0, (GInstanceInitFunc) valadoc_symbol_resolver_instance_init, NULL };
	GType valadoc_symbol_resolver_type_id;
	valadoc_symbol_resolver_type_id = g_type_register_static (VALADOC_API_TYPE_VISITOR, "ValadocSymbolResolver", &g_define_type_info, 0);
	ValadocSymbolResolver_private_offset = g_type_add_instance_private (valadoc_symbol_resolver_type_id, sizeof (ValadocSymbolResolverPrivate));
	return valadoc_symbol_resolver_type_id;
}

GType
valadoc_symbol_resolver_get_type (void)
{
	static volatile gsize valadoc_symbol_resolver_type_id__once = 0;
	if (g_once_init_enter (&valadoc_symbol_resolver_type_id__once)) {
		GType valadoc_symbol_resolver_type_id;
		valadoc_symbol_resolver_type_id = valadoc_symbol_resolver_get_type_once ();
		g_once_init_leave (&valadoc_symbol_resolver_type_id__once, valadoc_symbol_resolver_type_id);
	}
	return valadoc_symbol_resolver_type_id__once;
}

