Skip to content

Commit 54dd445

Browse files
committed
Correct generation of operator +.
1 parent 61dc376 commit 54dd445

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/reflect.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -4250,8 +4250,8 @@ auto autodiff(meta::type_declaration& t) -> void
42504250
CPP2_UFCS(error)(m, "temporary alpha limitation: the addition's right-hand side '" + cpp2::to_string(rhs) + "' must be a parameter or return name");
42514251
}
42524252

4253-
line1 += "" + cpp2::to_string(lhs) + " * " + cpp2::to_string(rhs) + "_d + " + cpp2::to_string(rhs) + " * " + cpp2::to_string(lhs) + "_d;";
4254-
line2 += "" + cpp2::to_string(cpp2::move(lhs)) + " * " + cpp2::to_string(cpp2::move(rhs)) + ";";
4253+
line1 += "" + cpp2::to_string(lhs) + "_d + " + cpp2::to_string(rhs) + "_d;";
4254+
line2 += "" + cpp2::to_string(cpp2::move(lhs)) + " + " + cpp2::to_string(cpp2::move(rhs)) + ";";
42554255

42564256
diff += cpp2::move(line1) + cpp2::move(line2);
42574257

source/reflect.h2

+2-2
Original file line numberDiff line numberDiff line change
@@ -2205,8 +2205,8 @@ autodiff: (inout t: meta::type_declaration) =
22052205
m.error( "temporary alpha limitation: the addition's right-hand side '(rhs)$' must be a parameter or return name");
22062206
}
22072207

2208-
line1 += "(lhs)$ * (rhs)$_d + (rhs)$ * (lhs)$_d;";
2209-
line2 += "(lhs)$ * (rhs)$;";
2208+
line1 += "(lhs)$_d + (rhs)$_d;";
2209+
line2 += "(lhs)$ + (rhs)$;";
22102210

22112211
diff += line1 + line2;
22122212

0 commit comments

Comments
 (0)