@@ -1382,30 +1382,6 @@ pub fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type {
1382
1382
final_arg_typ = exp_arg_sym.info.elem_type
1383
1383
final_arg_sym = c.table.sym (final_arg_typ)
1384
1384
}
1385
- if exp_arg_typ.has_flag (.generic) {
1386
- method_concrete_types := if method.generic_names.len == rec_concrete_types.len {
1387
- rec_concrete_types
1388
- } else {
1389
- concrete_types
1390
- }
1391
- if exp_utyp := c.table.resolve_generic_to_concrete (exp_arg_typ, method.generic_names,
1392
- method_concrete_types)
1393
- {
1394
- exp_arg_typ = exp_utyp
1395
- } else {
1396
- continue
1397
- }
1398
-
1399
- if got_arg_typ.has_flag (.generic) {
1400
- if got_utyp := c.table.resolve_generic_to_concrete (got_arg_typ, method.generic_names,
1401
- method_concrete_types)
1402
- {
1403
- got_arg_typ = got_utyp
1404
- } else {
1405
- continue
1406
- }
1407
- }
1408
- }
1409
1385
param := if method.is_variadic && i > = method.params.len - 1 {
1410
1386
method.params.last ()
1411
1387
} else {
@@ -1442,6 +1418,30 @@ pub fn (mut c Checker) method_call(mut node ast.CallExpr) ast.Type {
1442
1418
c.fail_if_unreadable (arg.expr, got_arg_typ, 'argument' )
1443
1419
}
1444
1420
}
1421
+ if exp_arg_typ.has_flag (.generic) {
1422
+ method_concrete_types := if method.generic_names.len == rec_concrete_types.len {
1423
+ rec_concrete_types
1424
+ } else {
1425
+ concrete_types
1426
+ }
1427
+ if exp_utyp := c.table.resolve_generic_to_concrete (exp_arg_typ, method.generic_names,
1428
+ method_concrete_types)
1429
+ {
1430
+ exp_arg_typ = exp_utyp
1431
+ } else {
1432
+ continue
1433
+ }
1434
+
1435
+ if got_arg_typ.has_flag (.generic) {
1436
+ if got_utyp := c.table.resolve_generic_to_concrete (got_arg_typ, method.generic_names,
1437
+ method_concrete_types)
1438
+ {
1439
+ got_arg_typ = got_utyp
1440
+ } else {
1441
+ continue
1442
+ }
1443
+ }
1444
+ }
1445
1445
if left_sym.info is ast.Array && method_name == 'sort_with_compare' {
1446
1446
elem_typ := left_sym.info.elem_type
1447
1447
arg_sym := c.table.sym (arg.typ)
0 commit comments