@@ -1307,8 +1307,8 @@ fn (mut t Transformer) transform_call_expr(expr ast.CallExpr) ast.Expr {
13071307 }
13081308 }
13091309 }
1310- is_module_call := sel.lhs is ast.Ident
1311- && (t. is_module_ident (sel.lhs.name) || (t.get_module_scope (sel.lhs.name) != none
1310+ is_module_call := sel.lhs is ast.Ident && (t. is_module_ident (sel.lhs.name)
1311+ || (t.get_module_scope (sel.lhs.name) != none
13121312 && t.lookup_var_type (sel.lhs.name) == none ))
13131313 if ! is_module_call {
13141314 if resolved := t.resolve_method_call_name (sel.lhs, sel.rhs.name) {
@@ -1445,24 +1445,24 @@ fn (mut t Transformer) transform_call_expr(expr ast.CallExpr) ast.Expr {
14451445 gai := expr.lhs as ast.GenericArgOrIndexExpr
14461446 if gai.lhs is ast.SelectorExpr {
14471447 sel := gai.lhs as ast.SelectorExpr
1448- is_module_call := sel.lhs is ast.Ident
1449- && (t. is_module_ident (sel.lhs.name) || (t.get_module_scope (sel.lhs.name) != none
1448+ is_module_call := sel.lhs is ast.Ident && (t. is_module_ident (sel.lhs.name)
1449+ || (t.get_module_scope (sel.lhs.name) != none
14501450 && t.lookup_var_type (sel.lhs.name) == none ))
14511451 if ! is_module_call {
14521452 // Compute generic specialization suffix from the type arg
14531453 suffix := '_' + t.generic_specialization_token (gai.expr)
14541454 // When receiver matches the current method's receiver parameter
14551455 // and get_expr_type would fail (generic body), use the known prefix
14561456 recv_is_self := t.cur_fn_recv_param != '' && sel.lhs is ast.Ident
1457- && (sel.lhs as ast.Ident ).name == t.cur_fn_recv_param
1458- && t.get_expr_type (sel.lhs) == none
1457+ && (sel.lhs as ast.Ident ).name == t.cur_fn_recv_param && t.get_expr_type (sel.lhs) == none
14591458 if recv_is_self && t.cur_fn_recv_prefix != '' {
14601459 call_args2 := t.lower_missing_call_args (expr.lhs, expr.args)
14611460 fn_info2 := t.lookup_call_fn_info (expr.lhs)
14621461 mut args2 := []ast.Expr{cap: call_args2 .len + 1 }
14631462 args2 << t.transform_expr (sel.lhs)
14641463 for i, arg in call_args2 {
1465- args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 , i)
1464+ args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 ,
1465+ i)
14661466 }
14671467 return ast.CallExpr{
14681468 lhs: ast.Ident{
@@ -1479,7 +1479,8 @@ fn (mut t Transformer) transform_call_expr(expr ast.CallExpr) ast.Expr {
14791479 mut args2 := []ast.Expr{cap: call_args2 .len + 1 }
14801480 args2 << t.transform_expr (sel.lhs)
14811481 for i, arg in call_args2 {
1482- args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 , i)
1482+ args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 ,
1483+ i)
14831484 }
14841485 return ast.CallExpr{
14851486 lhs: ast.Ident{
@@ -1496,7 +1497,8 @@ fn (mut t Transformer) transform_call_expr(expr ast.CallExpr) ast.Expr {
14961497 mut args2 := []ast.Expr{cap: call_args2 .len + 1 }
14971498 args2 << t.transform_expr (sel.lhs)
14981499 for i, arg in call_args2 {
1499- args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 , i)
1500+ args2 << t.transform_call_arg_with_sumtype_check (arg, fn_info2 ,
1501+ i)
15001502 }
15011503 return ast.CallExpr{
15021504 lhs: ast.Ident{
@@ -1901,9 +1903,7 @@ fn (t &Transformer) resolve_method_call_name(receiver ast.Expr, method_name stri
19011903}
19021904
19031905fn (mut t Transformer) lower_missing_call_args (lhs ast.Expr, args []ast.Expr) []ast.Expr {
1904- info := t.lookup_call_fn_info (lhs) or {
1905- return args
1906- }
1906+ info := t.lookup_call_fn_info (lhs) or { return args }
19071907 param_types := info.param_types
19081908 if param_types.len == 0 {
19091909 return args
@@ -2638,8 +2638,8 @@ fn (mut t Transformer) transform_call_or_cast_expr(expr ast.CallOrCastExpr) ast.
26382638 // Method call resolution: rewrite receiver.method(arg) -> Type__method(receiver, arg)
26392639 if expr.lhs is ast.SelectorExpr {
26402640 sel := expr.lhs as ast.SelectorExpr
2641- is_module_call := sel.lhs is ast.Ident
2642- && (t. is_module_ident (sel.lhs.name) || (t.get_module_scope (sel.lhs.name) != none
2641+ is_module_call := sel.lhs is ast.Ident && (t. is_module_ident (sel.lhs.name)
2642+ || (t.get_module_scope (sel.lhs.name) != none
26432643 && t.lookup_var_type (sel.lhs.name) == none ))
26442644 if ! is_module_call {
26452645 if resolved := t.resolve_method_call_name (sel.lhs, sel.rhs.name) {
@@ -2733,17 +2733,16 @@ fn (mut t Transformer) transform_call_or_cast_expr(expr ast.CallOrCastExpr) ast.
27332733 gai := expr.lhs as ast.GenericArgOrIndexExpr
27342734 if gai.lhs is ast.SelectorExpr {
27352735 sel := gai.lhs as ast.SelectorExpr
2736- is_module_call := sel.lhs is ast.Ident
2737- && (t. is_module_ident (sel.lhs.name) || (t.get_module_scope (sel.lhs.name) != none
2736+ is_module_call := sel.lhs is ast.Ident && (t. is_module_ident (sel.lhs.name)
2737+ || (t.get_module_scope (sel.lhs.name) != none
27382738 && t.lookup_var_type (sel.lhs.name) == none ))
27392739 if ! is_module_call {
27402740 suffix := '_' + t.generic_specialization_token (gai.expr)
27412741 // When the receiver matches the current method's receiver parameter
27422742 // and get_expr_type would fail (generic body), use the known prefix
27432743 // directly to avoid wrong fallback to 'array__' prefix.
27442744 recv_is_self := t.cur_fn_recv_param != '' && sel.lhs is ast.Ident
2745- && (sel.lhs as ast.Ident ).name == t.cur_fn_recv_param
2746- && t.get_expr_type (sel.lhs) == none
2745+ && (sel.lhs as ast.Ident ).name == t.cur_fn_recv_param && t.get_expr_type (sel.lhs) == none
27472746 if recv_is_self && t.cur_fn_recv_prefix != '' {
27482747 mut args2 := []ast.Expr{cap: 2 }
27492748 args2 << t.transform_expr (sel.lhs)
0 commit comments