if (ma.symbol_reference != null && ma.symbol_reference.get_attribute ("Assert") != null) {
this.is_assert = true;
- var args = get_argument_list ();
- if (args.size == 1) {
- this.source_reference = args[0].source_reference;
+ if (argument_list.size == 1) {
+ this.source_reference = argument_list[0].source_reference;
}
}
}
var struct_creation_expression = new ObjectCreationExpression ((MemberAccess) call, source_reference);
struct_creation_expression.struct_creation = true;
- foreach (Expression arg in get_argument_list ()) {
+ foreach (Expression arg in argument_list) {
struct_creation_expression.add_argument (arg);
}
struct_creation_expression.target_type = target_type;
Expression last_arg = null;
- var args = get_argument_list ();
- Iterator<Expression> arg_it = args.iterator ();
+ Iterator<Expression> arg_it = argument_list.iterator ();
foreach (Parameter param in params) {
if (!param.check (context)) {
error = true;
} else if (last_arg != null) {
// use last argument as format string
format_literal = StringLiteral.get_format_literal (last_arg);
- if (format_literal == null && args.size == params.size - 1) {
+ if (format_literal == null && argument_list.size == params.size - 1) {
// insert "%s" to avoid issues with embedded %
format_literal = new StringLiteral ("\"%s\"");
format_literal.target_type = context.analyzer.string_type.copy ();
- argument_list.insert (args.size - 1, format_literal);
+ argument_list.insert (argument_list.size - 1, format_literal);
// recreate iterator and skip to right position
arg_it = argument_list.iterator ();
}
bool force_lambda_method_closure = false;
- foreach (Expression arg in get_argument_list ()) {
+ foreach (Expression arg in argument_list) {
arg.check (context);
if (arg is LambdaExpression && ((LambdaExpression) arg).method.closure) {
// force all lambda arguments using the same closure scope
// TODO https://gitlab.gnome.org/GNOME/vala/issues/59
if (force_lambda_method_closure) {
- foreach (Expression arg in get_argument_list ()) {
+ foreach (Expression arg in argument_list) {
unowned LambdaExpression? lambda = arg as LambdaExpression;
if (lambda != null && lambda.method.binding != MemberBinding.STATIC) {
lambda.method.closure = true;
unowned Signal? sig = m.parent_symbol as Signal;
if (sig != null && m.name == "disconnect") {
- var param = get_argument_list ()[0];
+ var param = argument_list[0];
if (param is LambdaExpression) {
error = true;
Report.error (source_reference, "Cannot disconnect lambda expression from signal");
DataType type_arg = null;
// infer type arguments from arguments
- arg_it = args.iterator ();
+ arg_it = argument_list.iterator ();
foreach (Parameter param in params) {
if (param.ellipsis || param.params_array) {
break;
}
// recalculate argument target types with new information
- arg_it = args.iterator ();
+ arg_it = argument_list.iterator ();
foreach (Parameter param in params) {
if (param.ellipsis || param.params_array) {
break;
}
}
- if (!context.analyzer.check_arguments (this, mtype, params, get_argument_list ())) {
+ if (!context.analyzer.check_arguments (this, mtype, params, argument_list)) {
error = true;
return false;
}
//Resolve possible generic-type in SizeofExpression used as parameter default-value
- foreach (Expression arg in get_argument_list ()) {
+ foreach (Expression arg in argument_list) {
unowned SizeofExpression? sizeof_expr = arg as SizeofExpression;
if (sizeof_expr != null && sizeof_expr.type_reference is GenericType) {
var sizeof_type = sizeof_expr.type_reference.get_actual_type (target_object_type, method_type_args, this);
}
/* Check for constructv chain up */
- if (base_cm != null && base_cm.is_variadic () && args.size == base_cm.get_parameters ().size) {
- var this_last_arg = args[args.size-1];
+ if (base_cm != null && base_cm.is_variadic () && argument_list.size == base_cm.get_parameters ().size) {
+ var this_last_arg = argument_list[argument_list.size - 1];
if (this_last_arg.value_type is StructValueType && this_last_arg.value_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
is_constructv_chainup = true;
}
return false;
}
- if (symbol_reference == null && get_argument_list ().size != 0) {
+ if (symbol_reference == null && argument_list.size != 0) {
value_type = null;
error = true;
Report.error (source_reference, "No arguments allowed when constructing type `%s'".printf (type.get_full_name ()));
Expression last_arg = null;
- var args = get_argument_list ();
- Iterator<Expression> arg_it = args.iterator ();
+ Iterator<Expression> arg_it = argument_list.iterator ();
foreach (Parameter param in m.get_parameters ()) {
if (!param.check (context)) {
error = true;
} else if (last_arg != null) {
// use last argument as format string
format_literal = StringLiteral.get_format_literal (last_arg);
- if (format_literal == null && args.size == m.get_parameters ().size - 1) {
+ if (format_literal == null && argument_list.size == m.get_parameters ().size - 1) {
// insert "%s" to avoid issues with embedded %
format_literal = new StringLiteral ("\"%s\"");
format_literal.target_type = context.analyzer.string_type.copy ();
- argument_list.insert (args.size - 1, format_literal);
+ argument_list.insert (argument_list.size - 1, format_literal);
// recreate iterator and skip to right position
arg_it = argument_list.iterator ();
}
}
- foreach (Expression arg in args) {
+ foreach (Expression arg in argument_list) {
arg.check (context);
}
- context.analyzer.check_arguments (this, new MethodType (m), m.get_parameters (), args);
+ context.analyzer.check_arguments (this, new MethodType (m), m.get_parameters (), argument_list);
} else if (type_reference is ErrorType) {
if (type_reference != null) {
type_reference.check (context);
init.check (context);
}
- if (get_argument_list ().size == 0) {
+ if (argument_list.size == 0) {
error = true;
Report.error (source_reference, "Too few arguments, errors need at least 1 argument");
} else {
- Iterator<Expression> arg_it = get_argument_list ().iterator ();
+ Iterator<Expression> arg_it = argument_list.iterator ();
arg_it.next ();
var ex = arg_it.get ();
if (ex.value_type == null || !ex.value_type.compatible (context.analyzer.string_type)) {
}
}
- arg_it = get_argument_list ().iterator ();
+ arg_it = argument_list.iterator ();
arg_it.next ();
if (!context.analyzer.check_variadic_arguments (arg_it, 1, source_reference)) {
error = true;
}
//Resolve possible generic-type in SizeofExpression used as parameter default-value
- foreach (Expression arg in get_argument_list ()) {
+ foreach (Expression arg in argument_list) {
unowned SizeofExpression sizeof_expr = arg as SizeofExpression;
if (sizeof_expr != null && sizeof_expr.type_reference is GenericType) {
var sizeof_type = sizeof_expr.type_reference.get_actual_type (type_reference, type_reference.get_type_arguments (), this);