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

/* valalocalvariable.vala
 *
 * Copyright (C) 2006-2010  Jürg Billeter
 *
 * 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:
 * 	Jürg Billeter <j@bitron.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include "vala.h"
#include <stdlib.h>
#include <string.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))

struct _ValaLocalVariablePrivate {
	gboolean _is_result;
	gboolean _captured;
	gboolean _init;
};


static gpointer vala_local_variable_parent_class = NULL;

#define VALA_LOCAL_VARIABLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_LOCAL_VARIABLE, ValaLocalVariablePrivate))
static void vala_local_variable_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor);
static void vala_local_variable_real_accept_children (ValaCodeNode* base, ValaCodeVisitor* visitor);
static void vala_local_variable_real_replace_expression (ValaCodeNode* base, ValaExpression* old_node, ValaExpression* new_node);
static void vala_local_variable_real_replace_type (ValaCodeNode* base, ValaDataType* old_type, ValaDataType* new_type);
static gboolean vala_local_variable_real_check (ValaCodeNode* base, ValaCodeContext* context);
static void vala_local_variable_finalize (ValaCodeNode * obj);


/**
 * Creates a new local variable.
 *
 * @param name              name of the variable
 * @param initializer       optional initializer expression
 * @param source_reference  reference to source code
 * @return                  newly created variable declarator
 */
ValaLocalVariable* vala_local_variable_construct (GType object_type, ValaDataType* variable_type, const gchar* name, ValaExpression* initializer, ValaSourceReference* source_reference) {
	ValaLocalVariable* self = NULL;
	ValaDataType* _tmp0_;
	const gchar* _tmp1_;
	ValaExpression* _tmp2_;
	ValaSourceReference* _tmp3_;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = variable_type;
	_tmp1_ = name;
	_tmp2_ = initializer;
	_tmp3_ = source_reference;
	self = (ValaLocalVariable*) vala_variable_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, NULL);
	return self;
}


ValaLocalVariable* vala_local_variable_new (ValaDataType* variable_type, const gchar* name, ValaExpression* initializer, ValaSourceReference* source_reference) {
	return vala_local_variable_construct (VALA_TYPE_LOCAL_VARIABLE, variable_type, name, initializer, source_reference);
}


static void vala_local_variable_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor) {
	ValaLocalVariable * self;
	ValaCodeVisitor* _tmp0_;
	self = (ValaLocalVariable*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	vala_code_visitor_visit_local_variable (_tmp0_, self);
}


static void vala_local_variable_real_accept_children (ValaCodeNode* base, ValaCodeVisitor* visitor) {
	ValaLocalVariable * self;
	ValaExpression* _tmp0_;
	ValaExpression* _tmp1_;
	ValaDataType* _tmp8_;
	ValaDataType* _tmp9_;
	self = (ValaLocalVariable*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = vala_variable_get_initializer ((ValaVariable*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ValaExpression* _tmp2_;
		ValaExpression* _tmp3_;
		ValaCodeVisitor* _tmp4_;
		ValaCodeVisitor* _tmp5_;
		ValaExpression* _tmp6_;
		ValaExpression* _tmp7_;
		_tmp2_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = visitor;
		vala_code_node_accept ((ValaCodeNode*) _tmp3_, _tmp4_);
		_tmp5_ = visitor;
		_tmp6_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp7_ = _tmp6_;
		vala_code_visitor_visit_end_full_expression (_tmp5_, _tmp7_);
	}
	_tmp8_ = vala_variable_get_variable_type ((ValaVariable*) self);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != NULL) {
		ValaDataType* _tmp10_;
		ValaDataType* _tmp11_;
		ValaCodeVisitor* _tmp12_;
		_tmp10_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp11_ = _tmp10_;
		_tmp12_ = visitor;
		vala_code_node_accept ((ValaCodeNode*) _tmp11_, _tmp12_);
	}
}


static void vala_local_variable_real_replace_expression (ValaCodeNode* base, ValaExpression* old_node, ValaExpression* new_node) {
	ValaLocalVariable * self;
	ValaExpression* _tmp0_;
	ValaExpression* _tmp1_;
	ValaExpression* _tmp2_;
	self = (ValaLocalVariable*) base;
	g_return_if_fail (old_node != NULL);
	g_return_if_fail (new_node != NULL);
	_tmp0_ = vala_variable_get_initializer ((ValaVariable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = old_node;
	if (_tmp1_ == _tmp2_) {
		ValaExpression* _tmp3_;
		_tmp3_ = new_node;
		vala_variable_set_initializer ((ValaVariable*) self, _tmp3_);
	}
}


static void vala_local_variable_real_replace_type (ValaCodeNode* base, ValaDataType* old_type, ValaDataType* new_type) {
	ValaLocalVariable * self;
	ValaDataType* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	self = (ValaLocalVariable*) base;
	g_return_if_fail (old_type != NULL);
	g_return_if_fail (new_type != NULL);
	_tmp0_ = vala_variable_get_variable_type ((ValaVariable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = old_type;
	if (_tmp1_ == _tmp2_) {
		ValaDataType* _tmp3_;
		_tmp3_ = new_type;
		vala_variable_set_variable_type ((ValaVariable*) self, _tmp3_);
	}
}


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


static gboolean vala_local_variable_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaLocalVariable * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaDataType* _tmp4_;
	ValaDataType* _tmp5_;
	gboolean is_initializer_list = FALSE;
	gint initializer_size = 0;
	ValaExpression* _tmp13_;
	ValaExpression* _tmp14_;
	ValaDataType* _tmp28_;
	ValaDataType* _tmp29_;
	gboolean _tmp70_ = FALSE;
	ValaExpression* _tmp71_;
	ValaExpression* _tmp72_;
	ValaCodeContext* _tmp196_;
	ValaSemanticAnalyzer* _tmp197_;
	ValaSemanticAnalyzer* _tmp198_;
	ValaSymbol* _tmp199_;
	ValaSymbol* _tmp200_;
	ValaScope* _tmp201_;
	ValaScope* _tmp202_;
	const gchar* _tmp203_;
	const gchar* _tmp204_;
	ValaBlock* block = NULL;
	ValaCodeContext* _tmp205_;
	ValaSemanticAnalyzer* _tmp206_;
	ValaSemanticAnalyzer* _tmp207_;
	ValaSymbol* _tmp208_;
	ValaSymbol* _tmp209_;
	ValaBlock* _tmp210_;
	ValaBlock* _tmp211_;
	gboolean _tmp213_;
	gboolean _tmp214_;
	self = (ValaLocalVariable*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = vala_variable_get_variable_type ((ValaVariable*) self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		ValaDataType* _tmp6_;
		ValaDataType* _tmp7_;
		ValaDataType* _tmp10_;
		ValaDataType* _tmp11_;
		ValaCodeContext* _tmp12_;
		_tmp6_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp7_ = _tmp6_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, VALA_TYPE_VOID_TYPE)) {
			ValaSourceReference* _tmp8_;
			ValaSourceReference* _tmp9_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp8_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp9_ = _tmp8_;
			vala_report_error (_tmp9_, "'void' not supported as variable type");
			result = FALSE;
			return result;
		}
		_tmp10_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp11_ = _tmp10_;
		_tmp12_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp11_, _tmp12_);
	}
	is_initializer_list = FALSE;
	initializer_size = -1;
	_tmp13_ = vala_variable_get_initializer ((ValaVariable*) self);
	_tmp14_ = _tmp13_;
	if (_tmp14_ != NULL) {
		ValaExpression* _tmp15_;
		ValaExpression* _tmp16_;
		ValaDataType* _tmp17_;
		ValaDataType* _tmp18_;
		ValaExpression* _tmp19_;
		ValaExpression* _tmp20_;
		ValaExpression* _tmp25_;
		ValaExpression* _tmp26_;
		ValaCodeContext* _tmp27_;
		_tmp15_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp16_ = _tmp15_;
		_tmp17_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp18_ = _tmp17_;
		vala_expression_set_target_type (_tmp16_, _tmp18_);
		_tmp19_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp20_ = _tmp19_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, VALA_TYPE_INITIALIZER_LIST)) {
			ValaExpression* _tmp21_;
			ValaExpression* _tmp22_;
			gint _tmp23_;
			gint _tmp24_;
			_tmp21_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp22_ = _tmp21_;
			_tmp23_ = vala_initializer_list_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, VALA_TYPE_INITIALIZER_LIST, ValaInitializerList));
			_tmp24_ = _tmp23_;
			initializer_size = _tmp24_;
			is_initializer_list = TRUE;
		}
		_tmp25_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp26_ = _tmp25_;
		_tmp27_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp26_, _tmp27_);
	}
	_tmp28_ = vala_variable_get_variable_type ((ValaVariable*) self);
	_tmp29_ = _tmp28_;
	if (_tmp29_ == NULL) {
		ValaExpression* _tmp30_;
		ValaExpression* _tmp31_;
		ValaExpression* _tmp34_;
		ValaExpression* _tmp35_;
		ValaDataType* _tmp36_;
		ValaDataType* _tmp37_;
		ValaExpression* _tmp40_;
		ValaExpression* _tmp41_;
		ValaDataType* _tmp42_;
		ValaDataType* _tmp43_;
		ValaExpression* _tmp56_;
		ValaExpression* _tmp57_;
		ValaDataType* _tmp58_;
		ValaDataType* _tmp59_;
		ValaDataType* _tmp60_;
		ValaDataType* _tmp61_;
		ValaDataType* _tmp62_;
		ValaDataType* _tmp63_;
		ValaDataType* _tmp64_;
		ValaDataType* _tmp65_;
		ValaExpression* _tmp66_;
		ValaExpression* _tmp67_;
		ValaDataType* _tmp68_;
		ValaDataType* _tmp69_;
		_tmp30_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp31_ = _tmp30_;
		if (_tmp31_ == NULL) {
			ValaSourceReference* _tmp32_;
			ValaSourceReference* _tmp33_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp32_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp33_ = _tmp32_;
			vala_report_error (_tmp33_, "var declaration not allowed without initializer");
			result = FALSE;
			return result;
		}
		_tmp34_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp35_ = _tmp34_;
		_tmp36_ = vala_expression_get_value_type (_tmp35_);
		_tmp37_ = _tmp36_;
		if (_tmp37_ == NULL) {
			ValaSourceReference* _tmp38_;
			ValaSourceReference* _tmp39_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp38_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp39_ = _tmp38_;
			vala_report_error (_tmp39_, "var declaration not allowed with non-typed initializer");
			result = FALSE;
			return result;
		}
		_tmp40_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp41_ = _tmp40_;
		_tmp42_ = vala_expression_get_value_type (_tmp41_);
		_tmp43_ = _tmp42_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp43_, VALA_TYPE_FIELD_PROTOTYPE)) {
			ValaExpression* _tmp44_;
			ValaExpression* _tmp45_;
			ValaSourceReference* _tmp46_;
			ValaSourceReference* _tmp47_;
			ValaExpression* _tmp48_;
			ValaExpression* _tmp49_;
			ValaSymbol* _tmp50_;
			ValaSymbol* _tmp51_;
			gchar* _tmp52_;
			gchar* _tmp53_;
			gchar* _tmp54_;
			gchar* _tmp55_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp44_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp45_ = _tmp44_;
			_tmp46_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp49_ = _tmp48_;
			_tmp50_ = vala_expression_get_symbol_reference (_tmp49_);
			_tmp51_ = _tmp50_;
			_tmp52_ = vala_symbol_get_full_name (_tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = g_strdup_printf ("Access to instance member `%s' denied", _tmp53_);
			_tmp55_ = _tmp54_;
			vala_report_error (_tmp47_, _tmp55_);
			_g_free0 (_tmp55_);
			_g_free0 (_tmp53_);
			result = FALSE;
			return result;
		}
		_tmp56_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp57_ = _tmp56_;
		_tmp58_ = vala_expression_get_value_type (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = vala_data_type_copy (_tmp59_);
		_tmp61_ = _tmp60_;
		vala_variable_set_variable_type ((ValaVariable*) self, _tmp61_);
		_vala_code_node_unref0 (_tmp61_);
		_tmp62_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp63_ = _tmp62_;
		vala_data_type_set_value_owned (_tmp63_, TRUE);
		_tmp64_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp65_ = _tmp64_;
		vala_data_type_set_floating_reference (_tmp65_, FALSE);
		_tmp66_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp67_ = _tmp66_;
		_tmp68_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp69_ = _tmp68_;
		vala_expression_set_target_type (_tmp67_, _tmp69_);
	}
	_tmp71_ = vala_variable_get_initializer ((ValaVariable*) self);
	_tmp72_ = _tmp71_;
	if (_tmp72_ != NULL) {
		ValaExpression* _tmp73_;
		ValaExpression* _tmp74_;
		gboolean _tmp75_;
		gboolean _tmp76_;
		_tmp73_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp74_ = _tmp73_;
		_tmp75_ = vala_code_node_get_error ((ValaCodeNode*) _tmp74_);
		_tmp76_ = _tmp75_;
		_tmp70_ = !_tmp76_;
	} else {
		_tmp70_ = FALSE;
	}
	if (_tmp70_) {
		ValaExpression* _tmp77_;
		ValaExpression* _tmp78_;
		ValaDataType* _tmp79_;
		ValaDataType* _tmp80_;
		ValaExpression* _tmp127_;
		ValaExpression* _tmp128_;
		ValaDataType* _tmp129_;
		ValaDataType* _tmp130_;
		ValaDataType* _tmp131_;
		ValaDataType* _tmp132_;
		gboolean _tmp133_;
		ValaArrayType* variable_array_type = NULL;
		ValaDataType* _tmp148_;
		ValaDataType* _tmp149_;
		ValaArrayType* _tmp150_;
		gboolean _tmp151_ = FALSE;
		gboolean _tmp152_ = FALSE;
		gboolean _tmp153_ = FALSE;
		ValaArrayType* _tmp154_;
		gboolean _tmp170_ = FALSE;
		gboolean _tmp171_ = FALSE;
		ValaArrayType* _tmp172_;
		ValaExpression* _tmp182_;
		ValaExpression* _tmp183_;
		ValaDataType* _tmp184_;
		ValaDataType* _tmp185_;
		gboolean _tmp186_;
		_tmp77_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp78_ = _tmp77_;
		_tmp79_ = vala_expression_get_value_type (_tmp78_);
		_tmp80_ = _tmp79_;
		if (_tmp80_ == NULL) {
			gboolean _tmp81_ = FALSE;
			ValaExpression* _tmp82_;
			ValaExpression* _tmp83_;
			gboolean _tmp88_ = FALSE;
			ValaExpression* _tmp89_;
			ValaExpression* _tmp90_;
			ValaSymbol* _tmp91_;
			ValaSymbol* _tmp92_;
			_tmp82_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp83_ = _tmp82_;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp83_, VALA_TYPE_MEMBER_ACCESS)) {
				ValaExpression* _tmp84_;
				ValaExpression* _tmp85_;
				_tmp84_ = vala_variable_get_initializer ((ValaVariable*) self);
				_tmp85_ = _tmp84_;
				_tmp81_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp85_, VALA_TYPE_LAMBDA_EXPRESSION);
			} else {
				_tmp81_ = FALSE;
			}
			if (_tmp81_) {
				ValaSourceReference* _tmp86_;
				ValaSourceReference* _tmp87_;
				vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
				_tmp86_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
				_tmp87_ = _tmp86_;
				vala_report_error (_tmp87_, "expression type not allowed as initializer");
				result = FALSE;
				return result;
			}
			_tmp89_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp90_ = _tmp89_;
			_tmp91_ = vala_expression_get_symbol_reference (_tmp90_);
			_tmp92_ = _tmp91_;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp92_, VALA_TYPE_METHOD)) {
				ValaDataType* _tmp93_;
				ValaDataType* _tmp94_;
				_tmp93_ = vala_variable_get_variable_type ((ValaVariable*) self);
				_tmp94_ = _tmp93_;
				_tmp88_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp94_, VALA_TYPE_DELEGATE_TYPE);
			} else {
				_tmp88_ = FALSE;
			}
			if (_tmp88_) {
				ValaMethod* m = NULL;
				ValaExpression* _tmp95_;
				ValaExpression* _tmp96_;
				ValaSymbol* _tmp97_;
				ValaSymbol* _tmp98_;
				ValaMethod* _tmp99_;
				ValaDelegateType* dt = NULL;
				ValaDataType* _tmp100_;
				ValaDataType* _tmp101_;
				ValaDelegateType* _tmp102_;
				ValaDelegate* cb = NULL;
				ValaDelegateType* _tmp103_;
				ValaDelegate* _tmp104_;
				ValaDelegate* _tmp105_;
				ValaDelegate* _tmp106_;
				ValaDelegate* _tmp107_;
				ValaMethod* _tmp108_;
				ValaDelegateType* _tmp109_;
				gboolean _tmp110_;
				ValaExpression* _tmp121_;
				ValaExpression* _tmp122_;
				ValaDataType* _tmp123_;
				ValaDataType* _tmp124_;
				_tmp95_ = vala_variable_get_initializer ((ValaVariable*) self);
				_tmp96_ = _tmp95_;
				_tmp97_ = vala_expression_get_symbol_reference (_tmp96_);
				_tmp98_ = _tmp97_;
				_tmp99_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp98_, VALA_TYPE_METHOD, ValaMethod));
				m = _tmp99_;
				_tmp100_ = vala_variable_get_variable_type ((ValaVariable*) self);
				_tmp101_ = _tmp100_;
				_tmp102_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType));
				dt = _tmp102_;
				_tmp103_ = dt;
				_tmp104_ = vala_delegate_type_get_delegate_symbol (_tmp103_);
				_tmp105_ = _tmp104_;
				_tmp106_ = _vala_code_node_ref0 (_tmp105_);
				cb = _tmp106_;
				_tmp107_ = cb;
				_tmp108_ = m;
				_tmp109_ = dt;
				_tmp110_ = vala_delegate_matches_method (_tmp107_, _tmp108_, (ValaDataType*) _tmp109_);
				if (!_tmp110_) {
					ValaSourceReference* _tmp111_;
					ValaSourceReference* _tmp112_;
					ValaMethod* _tmp113_;
					gchar* _tmp114_;
					gchar* _tmp115_;
					ValaDelegate* _tmp116_;
					gchar* _tmp117_;
					gchar* _tmp118_;
					gchar* _tmp119_;
					gchar* _tmp120_;
					vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
					_tmp111_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
					_tmp112_ = _tmp111_;
					_tmp113_ = m;
					_tmp114_ = vala_symbol_get_full_name ((ValaSymbol*) _tmp113_);
					_tmp115_ = _tmp114_;
					_tmp116_ = cb;
					_tmp117_ = vala_symbol_get_full_name ((ValaSymbol*) _tmp116_);
					_tmp118_ = _tmp117_;
					_tmp119_ = g_strdup_printf ("declaration of method `%s' doesn't match declaration of callback `%s'", _tmp115_, _tmp118_);
					_tmp120_ = _tmp119_;
					vala_report_error (_tmp112_, _tmp120_);
					_g_free0 (_tmp120_);
					_g_free0 (_tmp118_);
					_g_free0 (_tmp115_);
					result = FALSE;
					_vala_code_node_unref0 (cb);
					_vala_code_node_unref0 (dt);
					_vala_code_node_unref0 (m);
					return result;
				}
				_tmp121_ = vala_variable_get_initializer ((ValaVariable*) self);
				_tmp122_ = _tmp121_;
				_tmp123_ = vala_variable_get_variable_type ((ValaVariable*) self);
				_tmp124_ = _tmp123_;
				vala_expression_set_value_type (_tmp122_, _tmp124_);
				_vala_code_node_unref0 (cb);
				_vala_code_node_unref0 (dt);
				_vala_code_node_unref0 (m);
			} else {
				ValaSourceReference* _tmp125_;
				ValaSourceReference* _tmp126_;
				vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
				_tmp125_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
				_tmp126_ = _tmp125_;
				vala_report_error (_tmp126_, "expression type not allowed as initializer");
				result = FALSE;
				return result;
			}
		}
		_tmp127_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp128_ = _tmp127_;
		_tmp129_ = vala_expression_get_value_type (_tmp128_);
		_tmp130_ = _tmp129_;
		_tmp131_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp132_ = _tmp131_;
		_tmp133_ = vala_data_type_compatible (_tmp130_, _tmp132_);
		if (!_tmp133_) {
			ValaSourceReference* _tmp134_;
			ValaSourceReference* _tmp135_;
			ValaExpression* _tmp136_;
			ValaExpression* _tmp137_;
			ValaDataType* _tmp138_;
			ValaDataType* _tmp139_;
			gchar* _tmp140_;
			gchar* _tmp141_;
			ValaDataType* _tmp142_;
			ValaDataType* _tmp143_;
			gchar* _tmp144_;
			gchar* _tmp145_;
			gchar* _tmp146_;
			gchar* _tmp147_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp134_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp135_ = _tmp134_;
			_tmp136_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp137_ = _tmp136_;
			_tmp138_ = vala_expression_get_value_type (_tmp137_);
			_tmp139_ = _tmp138_;
			_tmp140_ = vala_code_node_to_string ((ValaCodeNode*) _tmp139_);
			_tmp141_ = _tmp140_;
			_tmp142_ = vala_variable_get_variable_type ((ValaVariable*) self);
			_tmp143_ = _tmp142_;
			_tmp144_ = vala_code_node_to_string ((ValaCodeNode*) _tmp143_);
			_tmp145_ = _tmp144_;
			_tmp146_ = g_strdup_printf ("Assignment: Cannot convert from `%s' to `%s'", _tmp141_, _tmp145_);
			_tmp147_ = _tmp146_;
			vala_report_error (_tmp135_, _tmp147_);
			_g_free0 (_tmp147_);
			_g_free0 (_tmp145_);
			_g_free0 (_tmp141_);
			result = FALSE;
			return result;
		}
		_tmp148_ = vala_variable_get_variable_type ((ValaVariable*) self);
		_tmp149_ = _tmp148_;
		_tmp150_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp149_, VALA_TYPE_ARRAY_TYPE) ? ((ValaArrayType*) _tmp149_) : NULL);
		variable_array_type = _tmp150_;
		_tmp154_ = variable_array_type;
		if (_tmp154_ != NULL) {
			ValaArrayType* _tmp155_;
			gboolean _tmp156_;
			gboolean _tmp157_;
			_tmp155_ = variable_array_type;
			_tmp156_ = vala_array_type_get_inline_allocated (_tmp155_);
			_tmp157_ = _tmp156_;
			_tmp153_ = _tmp157_;
		} else {
			_tmp153_ = FALSE;
		}
		if (_tmp153_) {
			ValaArrayType* _tmp158_;
			gboolean _tmp159_;
			gboolean _tmp160_;
			_tmp158_ = variable_array_type;
			_tmp159_ = vala_array_type_get_fixed_length (_tmp158_);
			_tmp160_ = _tmp159_;
			_tmp152_ = !_tmp160_;
		} else {
			_tmp152_ = FALSE;
		}
		if (_tmp152_) {
			gboolean _tmp161_;
			_tmp161_ = is_initializer_list;
			_tmp151_ = _tmp161_;
		} else {
			_tmp151_ = FALSE;
		}
		if (_tmp151_) {
			ValaArrayType* _tmp162_;
			gint _tmp163_;
			gchar* _tmp164_;
			gchar* _tmp165_;
			ValaIntegerLiteral* _tmp166_;
			ValaIntegerLiteral* _tmp167_;
			ValaArrayType* _tmp168_;
			ValaArrayType* _tmp169_;
			_tmp162_ = variable_array_type;
			_tmp163_ = initializer_size;
			_tmp164_ = g_strdup_printf ("%i", _tmp163_);
			_tmp165_ = _tmp164_;
			_tmp166_ = vala_integer_literal_new (_tmp165_, NULL);
			_tmp167_ = _tmp166_;
			vala_array_type_set_length (_tmp162_, (ValaExpression*) _tmp167_);
			_vala_code_node_unref0 (_tmp167_);
			_g_free0 (_tmp165_);
			_tmp168_ = variable_array_type;
			vala_array_type_set_fixed_length (_tmp168_, TRUE);
			_tmp169_ = variable_array_type;
			vala_data_type_set_nullable ((ValaDataType*) _tmp169_, FALSE);
		}
		_tmp172_ = variable_array_type;
		if (_tmp172_ != NULL) {
			ValaArrayType* _tmp173_;
			gboolean _tmp174_;
			gboolean _tmp175_;
			_tmp173_ = variable_array_type;
			_tmp174_ = vala_array_type_get_inline_allocated (_tmp173_);
			_tmp175_ = _tmp174_;
			_tmp171_ = _tmp175_;
		} else {
			_tmp171_ = FALSE;
		}
		if (_tmp171_) {
			ValaExpression* _tmp176_;
			ValaExpression* _tmp177_;
			ValaDataType* _tmp178_;
			ValaDataType* _tmp179_;
			_tmp176_ = vala_variable_get_initializer ((ValaVariable*) self);
			_tmp177_ = _tmp176_;
			_tmp178_ = vala_expression_get_value_type (_tmp177_);
			_tmp179_ = _tmp178_;
			_tmp170_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp179_, VALA_TYPE_ARRAY_TYPE) == FALSE;
		} else {
			_tmp170_ = FALSE;
		}
		if (_tmp170_) {
			ValaSourceReference* _tmp180_;
			ValaSourceReference* _tmp181_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp180_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp181_ = _tmp180_;
			vala_report_error (_tmp181_, "only arrays are allowed as initializer for arrays with fixed length");
			result = FALSE;
			_vala_code_node_unref0 (variable_array_type);
			return result;
		}
		_tmp182_ = vala_variable_get_initializer ((ValaVariable*) self);
		_tmp183_ = _tmp182_;
		_tmp184_ = vala_expression_get_value_type (_tmp183_);
		_tmp185_ = _tmp184_;
		_tmp186_ = vala_data_type_is_disposable (_tmp185_);
		if (_tmp186_) {
			gboolean _tmp187_ = FALSE;
			ValaDataType* _tmp188_;
			ValaDataType* _tmp189_;
			_tmp188_ = vala_variable_get_variable_type ((ValaVariable*) self);
			_tmp189_ = _tmp188_;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp189_, VALA_TYPE_POINTER_TYPE)) {
				ValaDataType* _tmp190_;
				ValaDataType* _tmp191_;
				gboolean _tmp192_;
				gboolean _tmp193_;
				_tmp190_ = vala_variable_get_variable_type ((ValaVariable*) self);
				_tmp191_ = _tmp190_;
				_tmp192_ = vala_data_type_get_value_owned (_tmp191_);
				_tmp193_ = _tmp192_;
				_tmp187_ = !_tmp193_;
			} else {
				_tmp187_ = FALSE;
			}
			if (_tmp187_) {
				ValaSourceReference* _tmp194_;
				ValaSourceReference* _tmp195_;
				vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
				_tmp194_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
				_tmp195_ = _tmp194_;
				vala_report_error (_tmp195_, "Invalid assignment from owned expression to unowned variable");
				result = FALSE;
				_vala_code_node_unref0 (variable_array_type);
				return result;
			}
		}
		_vala_code_node_unref0 (variable_array_type);
	}
	_tmp196_ = context;
	_tmp197_ = vala_code_context_get_analyzer (_tmp196_);
	_tmp198_ = _tmp197_;
	_tmp199_ = vala_semantic_analyzer_get_current_symbol (_tmp198_);
	_tmp200_ = _tmp199_;
	_tmp201_ = vala_symbol_get_scope (_tmp200_);
	_tmp202_ = _tmp201_;
	_tmp203_ = vala_symbol_get_name ((ValaSymbol*) self);
	_tmp204_ = _tmp203_;
	vala_scope_add (_tmp202_, _tmp204_, (ValaSymbol*) self);
	_tmp205_ = context;
	_tmp206_ = vala_code_context_get_analyzer (_tmp205_);
	_tmp207_ = _tmp206_;
	_tmp208_ = vala_semantic_analyzer_get_current_symbol (_tmp207_);
	_tmp209_ = _tmp208_;
	_tmp210_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp209_, VALA_TYPE_BLOCK) ? ((ValaBlock*) _tmp209_) : NULL);
	block = _tmp210_;
	_tmp211_ = block;
	if (_tmp211_ != NULL) {
		ValaBlock* _tmp212_;
		_tmp212_ = block;
		vala_block_add_local_variable (_tmp212_, self);
	}
	vala_symbol_set_active ((ValaSymbol*) self, TRUE);
	_tmp213_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp214_ = _tmp213_;
	result = !_tmp214_;
	_vala_code_node_unref0 (block);
	return result;
}


gboolean vala_local_variable_get_is_result (ValaLocalVariable* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_result;
	result = _tmp0_;
	return result;
}


void vala_local_variable_set_is_result (ValaLocalVariable* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_is_result = _tmp0_;
}


gboolean vala_local_variable_get_captured (ValaLocalVariable* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_captured;
	result = _tmp0_;
	return result;
}


void vala_local_variable_set_captured (ValaLocalVariable* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_captured = _tmp0_;
}


gboolean vala_local_variable_get_init (ValaLocalVariable* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_init;
	result = _tmp0_;
	return result;
}


void vala_local_variable_set_init (ValaLocalVariable* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_init = _tmp0_;
}


static void vala_local_variable_class_init (ValaLocalVariableClass * klass) {
	vala_local_variable_parent_class = g_type_class_peek_parent (klass);
	((ValaCodeNodeClass *) klass)->finalize = vala_local_variable_finalize;
	g_type_class_add_private (klass, sizeof (ValaLocalVariablePrivate));
	((ValaCodeNodeClass *) klass)->accept = (void (*) (ValaCodeNode *, ValaCodeVisitor*)) vala_local_variable_real_accept;
	((ValaCodeNodeClass *) klass)->accept_children = (void (*) (ValaCodeNode *, ValaCodeVisitor*)) vala_local_variable_real_accept_children;
	((ValaCodeNodeClass *) klass)->replace_expression = (void (*) (ValaCodeNode *, ValaExpression*, ValaExpression*)) vala_local_variable_real_replace_expression;
	((ValaCodeNodeClass *) klass)->replace_type = (void (*) (ValaCodeNode *, ValaDataType*, ValaDataType*)) vala_local_variable_real_replace_type;
	((ValaCodeNodeClass *) klass)->check = (gboolean (*) (ValaCodeNode *, ValaCodeContext*)) vala_local_variable_real_check;
}


static void vala_local_variable_instance_init (ValaLocalVariable * self) {
	self->priv = VALA_LOCAL_VARIABLE_GET_PRIVATE (self);
}


static void vala_local_variable_finalize (ValaCodeNode * obj) {
	ValaLocalVariable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_LOCAL_VARIABLE, ValaLocalVariable);
	VALA_CODE_NODE_CLASS (vala_local_variable_parent_class)->finalize (obj);
}


/**
 * Represents a local variable declaration in the source code.
 */
GType vala_local_variable_get_type (void) {
	static volatile gsize vala_local_variable_type_id__volatile = 0;
	if (g_once_init_enter (&vala_local_variable_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaLocalVariableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_local_variable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaLocalVariable), 0, (GInstanceInitFunc) vala_local_variable_instance_init, NULL };
		GType vala_local_variable_type_id;
		vala_local_variable_type_id = g_type_register_static (VALA_TYPE_VARIABLE, "ValaLocalVariable", &g_define_type_info, 0);
		g_once_init_leave (&vala_local_variable_type_id__volatile, vala_local_variable_type_id);
	}
	return vala_local_variable_type_id__volatile;
}



