methods/bug653391.vala \
methods/bug653908.vala \
methods/bug663210.vala \
+ methods/bug723009.vala \
methods/generics.vala \
control-flow/break.vala \
control-flow/expressions-conditional.vala \
--- /dev/null
+public string foo () throws Error {
+ return "foo";
+}
+
+void main () {
+ Value bar;
+ bar = foo ();
+ assert ((string) bar == "foo");
+}
\ No newline at end of file
var sig = (Signal) ma.symbol_reference;
right.target_type = new DelegateType (sig.get_delegate (ma.inner.value_type, this));
} else {
- right.formal_target_type = ma.formal_value_type;
- right.target_type = ma.value_type;
+ right.formal_target_type = ma.formal_value_type.copy ();
+ right.target_type = ma.value_type.copy ();
}
} else if (left is ElementAccess) {
var ea = (ElementAccess) left;
// store parent_node as we need to replace the expression in the old parent node later on
var old_parent_node = parent_node;
- var local = new LocalVariable (value_type, get_temp_name (), null, source_reference);
+ var local = new LocalVariable (value_type.copy (), get_temp_name (), null, source_reference);
var decl = new DeclarationStatement (local, source_reference);
insert_statement (context.analyzer.insert_block, decl);
+ var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
+
// don't set initializer earlier as this changes parent_node and parent_statement
local.initializer = this;
decl.check (context);
- var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
- temp_access.check (context);
// move temp variable to insert block to ensure the
// variable is in the same block as the declaration
context.analyzer.insert_block.add_local_variable (local);
old_parent_node.replace_expression (this, temp_access);
+ temp_access.check (context);
}
}
// store parent_node as we need to replace the expression in the old parent node later on
var old_parent_node = parent_node;
- var local = new LocalVariable (value_type, get_temp_name (), null, source_reference);
+ var local = new LocalVariable (value_type.copy (), get_temp_name (), null, source_reference);
var decl = new DeclarationStatement (local, source_reference);
insert_statement (context.analyzer.insert_block, decl);
+ var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
// don't set initializer earlier as this changes parent_node and parent_statement
local.initializer = this;
decl.check (context);
- var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
- temp_access.check (context);
// move temp variable to insert block to ensure the
// variable is in the same block as the declaration
context.analyzer.insert_block.add_local_variable (local);
old_parent_node.replace_expression (this, temp_access);
+ temp_access.check (context);
}
}