1584
1584
ValaSourceReference* vala_code_node_get_source_reference (ValaCodeNode* self);
1585
1585
ValaList* vala_data_type_get_parameters (ValaDataType* self);
1586
1586
char* vala_method_type_to_prototype_string (ValaMethodType* self, gboolean with_type_parameters);
1587
char* vala_code_node_to_string (ValaCodeNode* self);
1587
1588
void vala_method_call_add_argument (ValaMethodCall* self, ValaExpression* arg);
1588
1589
void vala_object_creation_expression_add_argument (ValaObjectCreationExpression* self, ValaExpression* arg);
1589
1590
gboolean vala_code_node_get_error (ValaCodeNode* self);
1591
1592
ValaSymbol* vala_expression_get_symbol_reference (ValaExpression* self);
1592
1593
ValaDataType* vala_expression_get_target_type (ValaExpression* self);
1593
1594
gboolean vala_data_type_compatible (ValaDataType* self, ValaDataType* target_type);
1594
char* vala_code_node_to_string (ValaCodeNode* self);
1595
1595
ValaSourceFile* vala_source_reference_get_file (ValaSourceReference* self);
1596
1596
const char* vala_source_file_get_filename (ValaSourceFile* self);
1597
1597
gint vala_source_reference_get_first_line (ValaSourceReference* self);
2201
2201
gboolean ellipsis;
2203
gboolean _tmp21_ = FALSE;
2203
gboolean _tmp27_ = FALSE;
2204
2204
g_return_val_if_fail (self != NULL, FALSE);
2205
2205
g_return_val_if_fail (expr != NULL, FALSE);
2206
2206
g_return_val_if_fail (mtype != NULL, FALSE);
2273
2273
if (vala_variable_get_initializer ((ValaVariable*) param) == NULL) {
2274
ValaDataType* _tmp3_;
2274
2275
ValaMethodType* m;
2278
m = _vala_code_node_ref0 (VALA_METHOD_TYPE (mtype));
2279
2276
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2280
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp5_ = g_strdup_printf ("%d missing arguments for `%s'", vala_collection_get_size ((ValaCollection*) (_tmp3_ = vala_data_type_get_parameters ((ValaDataType*) m))) - vala_collection_get_size ((ValaCollection*) args), _tmp4_ = vala_method_type_to_prototype_string (m, FALSE)));
2283
_vala_collection_object_unref0 (_tmp3_);
2277
m = _vala_code_node_ref0 ((_tmp3_ = mtype, VALA_IS_METHOD_TYPE (_tmp3_) ? ((ValaMethodType*) _tmp3_) : NULL));
2282
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp6_ = g_strdup_printf ("%d missing arguments for `%s'", vala_collection_get_size ((ValaCollection*) (_tmp4_ = vala_data_type_get_parameters ((ValaDataType*) m))) - vala_collection_get_size ((ValaCollection*) args), _tmp5_ = vala_method_type_to_prototype_string (m, FALSE)));
2285
_vala_collection_object_unref0 (_tmp4_);
2289
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp8_ = g_strdup_printf ("Too few arguments, method `%s' does not take %d arguments", _tmp7_ = vala_code_node_to_string ((ValaCodeNode*) mtype), vala_collection_get_size ((ValaCollection*) args)));
2284
2293
result = FALSE;
2285
2294
_vala_code_node_unref0 (m);
2286
2295
_vala_code_node_unref0 (param);
2289
2298
_vala_code_node_unref0 (prev_arg);
2292
ValaExpression* _tmp6_;
2301
ValaExpression* _tmp9_;
2293
2302
ValaMethodCall* invocation_expr;
2294
ValaExpression* _tmp7_;
2303
ValaExpression* _tmp10_;
2295
2304
ValaObjectCreationExpression* object_creation_expr;
2296
ValaIterator* _tmp8_;
2297
invocation_expr = _vala_code_node_ref0 ((_tmp6_ = expr, VALA_IS_METHOD_CALL (_tmp6_) ? ((ValaMethodCall*) _tmp6_) : NULL));
2298
object_creation_expr = _vala_code_node_ref0 ((_tmp7_ = expr, VALA_IS_OBJECT_CREATION_EXPRESSION (_tmp7_) ? ((ValaObjectCreationExpression*) _tmp7_) : NULL));
2305
ValaIterator* _tmp11_;
2306
invocation_expr = _vala_code_node_ref0 ((_tmp9_ = expr, VALA_IS_METHOD_CALL (_tmp9_) ? ((ValaMethodCall*) _tmp9_) : NULL));
2307
object_creation_expr = _vala_code_node_ref0 ((_tmp10_ = expr, VALA_IS_OBJECT_CREATION_EXPRESSION (_tmp10_) ? ((ValaObjectCreationExpression*) _tmp10_) : NULL));
2299
2308
if (invocation_expr != NULL) {
2300
2309
vala_method_call_add_argument (invocation_expr, vala_variable_get_initializer ((ValaVariable*) param));
2305
2314
g_assert_not_reached ();
2308
arg_it = (_tmp8_ = NULL, _vala_collection_object_unref0 (arg_it), _tmp8_);
2317
arg_it = (_tmp11_ = NULL, _vala_collection_object_unref0 (arg_it), _tmp11_);
2309
2318
_vala_code_node_unref0 (object_creation_expr);
2310
2319
_vala_code_node_unref0 (invocation_expr);
2313
2322
ValaExpression* arg;
2314
ValaExpression* _tmp9_;
2323
ValaExpression* _tmp12_;
2315
2324
arg = (ValaExpression*) vala_iterator_get (arg_it);
2316
2325
if (!vala_semantic_analyzer_check_argument (self, arg, i, vala_formal_parameter_get_direction (param))) {
2317
2326
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2323
2332
_vala_code_node_unref0 (prev_arg);
2326
prev_arg = (_tmp9_ = _vala_code_node_ref0 (arg), _vala_code_node_unref0 (prev_arg), _tmp9_);
2335
prev_arg = (_tmp12_ = _vala_code_node_ref0 (arg), _vala_code_node_unref0 (prev_arg), _tmp12_);
2328
2337
_vala_code_node_unref0 (arg);
2334
2343
if (ellipsis) {
2336
gboolean _tmp10_ = FALSE;
2345
gboolean _tmp13_ = FALSE;
2337
2346
ValaExpression* arg;
2338
2347
if (arg_it != NULL) {
2339
_tmp10_ = vala_iterator_next (arg_it);
2348
_tmp13_ = vala_iterator_next (arg_it);
2346
2355
arg = (ValaExpression*) vala_iterator_get (arg_it);
2364
2373
if (vala_expression_get_value_type (arg) == NULL) {
2365
2374
if (!VALA_IS_METHOD (vala_expression_get_symbol_reference (arg))) {
2367
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2368
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp11_ = g_strdup_printf ("Invalid type for argument %d", i + 1));
2371
_vala_code_node_unref0 (arg);
2372
_vala_collection_object_unref0 (arg_it);
2373
_vala_code_node_unref0 (prev_arg);
2377
gboolean _tmp12_ = FALSE;
2378
if (vala_expression_get_target_type (arg) != NULL) {
2379
_tmp12_ = !vala_data_type_compatible (vala_expression_get_value_type (arg), vala_expression_get_target_type (arg));
2387
2376
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2388
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) arg), _tmp15_ = g_strdup_printf ("Argument %d: Cannot convert from `%s' to `%s'", i + 1, _tmp13_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (arg)), _tmp14_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_target_type (arg))));
2377
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp14_ = g_strdup_printf ("Invalid type for argument %d", i + 1));
2390
2378
_g_free0 (_tmp14_);
2380
_vala_code_node_unref0 (arg);
2381
_vala_collection_object_unref0 (arg_it);
2382
_vala_code_node_unref0 (prev_arg);
2386
gboolean _tmp15_ = FALSE;
2387
if (vala_expression_get_target_type (arg) != NULL) {
2388
_tmp15_ = !vala_data_type_compatible (vala_expression_get_value_type (arg), vala_expression_get_target_type (arg));
2396
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2397
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) arg), _tmp18_ = g_strdup_printf ("Argument %d: Cannot convert from `%s' to `%s'", i + 1, _tmp16_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_value_type (arg)), _tmp17_ = vala_code_node_to_string ((ValaCodeNode*) vala_expression_get_target_type (arg))));
2392
2401
result = FALSE;
2393
2402
_vala_code_node_unref0 (arg);
2394
2403
_vala_collection_object_unref0 (arg_it);
2402
2411
_vala_code_node_unref0 (arg);
2405
gboolean _tmp16_ = FALSE;
2406
gboolean _tmp17_ = FALSE;
2414
gboolean _tmp19_ = FALSE;
2415
gboolean _tmp20_ = FALSE;
2407
2416
if (!ellipsis) {
2408
_tmp17_ = arg_it != NULL;
2413
_tmp16_ = vala_iterator_next (arg_it);
2417
_tmp20_ = arg_it != NULL;
2422
_tmp19_ = vala_iterator_next (arg_it);
2427
ValaDataType* _tmp21_;
2418
2428
ValaMethodType* m;
2422
m = _vala_code_node_ref0 (VALA_METHOD_TYPE (mtype));
2423
2429
vala_code_node_set_error ((ValaCodeNode*) expr, TRUE);
2424
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp20_ = g_strdup_printf ("%d extra arguments for `%s'", vala_collection_get_size ((ValaCollection*) args) - vala_collection_get_size ((ValaCollection*) (_tmp18_ = vala_data_type_get_parameters ((ValaDataType*) m))), _tmp19_ = vala_method_type_to_prototype_string (m, FALSE)));
2427
_vala_collection_object_unref0 (_tmp18_);
2430
m = _vala_code_node_ref0 ((_tmp21_ = mtype, VALA_IS_METHOD_TYPE (_tmp21_) ? ((ValaMethodType*) _tmp21_) : NULL));
2435
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp24_ = g_strdup_printf ("%d extra arguments for `%s'", vala_collection_get_size ((ValaCollection*) args) - vala_collection_get_size ((ValaCollection*) (_tmp22_ = vala_data_type_get_parameters ((ValaDataType*) m))), _tmp23_ = vala_method_type_to_prototype_string (m, FALSE)));
2438
_vala_collection_object_unref0 (_tmp22_);
2442
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) expr), _tmp26_ = g_strdup_printf ("Too many arguments, method `%s' does not take %d arguments", _tmp25_ = vala_code_node_to_string ((ValaCodeNode*) mtype), vala_collection_get_size ((ValaCollection*) args)));
2428
2446
result = FALSE;
2429
2447
_vala_code_node_unref0 (m);
2430
2448
_vala_collection_object_unref0 (arg_it);
2436
_tmp21_ = prev_arg != NULL;
2454
_tmp27_ = prev_arg != NULL;
2441
ValaExpression* _tmp22_;
2459
ValaExpression* _tmp28_;
2442
2460
ValaStringLiteral* format_arg;
2443
format_arg = _vala_code_node_ref0 ((_tmp22_ = prev_arg, VALA_IS_STRING_LITERAL (_tmp22_) ? ((ValaStringLiteral*) _tmp22_) : NULL));
2461
format_arg = _vala_code_node_ref0 ((_tmp28_ = prev_arg, VALA_IS_STRING_LITERAL (_tmp28_) ? ((ValaStringLiteral*) _tmp28_) : NULL));
2444
2462
if (format_arg != NULL) {
2447
vala_string_literal_set_value (format_arg, _tmp24_ = g_strdup_printf ("\"%s:%d: %s", _tmp23_ = g_path_get_basename (vala_source_file_get_filename (vala_source_reference_get_file (vala_code_node_get_source_reference ((ValaCodeNode*) expr)))), vala_source_reference_get_first_line (vala_code_node_get_source_reference ((ValaCodeNode*) expr)), g_utf8_offset_to_pointer (vala_string_literal_get_value (format_arg), (glong) 1)));
2465
vala_string_literal_set_value (format_arg, _tmp30_ = g_strdup_printf ("\"%s:%d: %s", _tmp29_ = g_path_get_basename (vala_source_file_get_filename (vala_source_reference_get_file (vala_code_node_get_source_reference ((ValaCodeNode*) expr)))), vala_source_reference_get_first_line (vala_code_node_get_source_reference ((ValaCodeNode*) expr)), g_utf8_offset_to_pointer (vala_string_literal_get_value (format_arg), (glong) 1)));
2451
2469
_vala_code_node_unref0 (format_arg);