* anonymous methods with implicitly typed parameters.
*/
public class Vala.LambdaExpression : Expression {
+ private static int next_lambda_id = 0;
+
/**
* The expression body of this lambda expression. Only one of
* expression_body or statement_body may be set.
return false;
}
- string get_lambda_name (CodeContext context) {
- var result = "_lambda%d_".printf (context.analyzer.next_lambda_id);
-
- context.analyzer.next_lambda_id++;
-
- return result;
- }
-
public override bool check (CodeContext context) {
if (checked) {
return !error;
var cb = (Delegate) ((DelegateType) target_type).delegate_symbol;
var return_type = cb.return_type.get_actual_type (target_type, null, this);
- method = new Method (get_lambda_name (context), return_type, source_reference);
+ method = new Method ("_lambda%d_".printf (next_lambda_id++), return_type, source_reference);
// track usage for flow analyzer
method.used = true;
method.version.check (source_reference);
public DataType error_type;
public Class gsource_type;
- public int next_lambda_id = 0;
-
// keep replaced alive to make sure they remain valid
// for the whole execution of CodeNode.accept
public List<CodeNode> replaced_nodes = new ArrayList<CodeNode> ();