+2007-09-01 Jürg Billeter <j@bitron.ch>
+
+ * vala/valasemanticanalyzer.vala: check arguments of methods with
+ ellipsis parameters
+
2007-08-31 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: improve error reporting for
return false;
} else if (arg.static_type == null) {
// disallow untyped arguments except for type inference of callbacks
- if (!(param.type_reference.data_type is Callback)) {
+ if (!(param.type_reference.data_type is Callback) || !(arg.symbol_reference is Method)) {
expr.error = true;
Report.error (expr.source_reference, "Invalid type for argument %d".printf (i + 1));
return false;
}
}
- if (!ellipsis && arg_it.next ()) {
+ if (ellipsis) {
+ while (arg_it.next ()) {
+ var arg = arg_it.get ();
+ if (arg.error) {
+ // ignore inner error
+ expr.error = true;
+ return false;
+ } else if (arg.static_type == null) {
+ // disallow untyped arguments except for type inference of callbacks
+ if (!(arg.symbol_reference is Method)) {
+ expr.error = true;
+ Report.error (expr.source_reference, "Invalid type for argument %d".printf (i + 1));
+ return false;
+ }
+ }
+
+ i++;
+ }
+ } else if (!ellipsis && arg_it.next ()) {
expr.error = true;
Report.error (expr.source_reference, "Too many arguments, method `%s' does not take %d arguments".printf (msym.get_full_name (), args.size));
return false;