da1f575431d7 — Leonard Ritter 13 days ago
* prover.cpp: loop merge conflict error now points to loop header as source. Previously the error message was anchored to the return type that precedes the conflicting one. This makes sense for functions where the return type is inferred by the return points, but not for loops where we always know the type (from the header).
1 files changed, 1 insertions(+), 3 deletions(-)

M src/prover.cpp
M src/prover.cpp +1 -3
@@ 1260,12 1260,10 @@ static SCOPES_RESULT(TypedValueRef) prov
     const Type *rtype = newloop->args->get_type();
-    const Anchor *last_anchor = result.anchor();
     for (auto repeat : newloop->repeats) {
         SCOPES_CHECK_RESULT(merge_value_type("loop repeat", rtype,
-            last_anchor, repeat.anchor()));
-        last_anchor = repeat.anchor();
+            newloop.anchor(), repeat.anchor()));
     return TypedValueRef(newloop);