Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mail-b.sr.ht (Postfix) with ESMTPS id F3C6BFF0A9 for <~duangle/scopes@lists.sr.ht>; Mon, 29 Jun 2020 13:51:37 +0000 (UTC) Authentication-Results: mail-b.sr.ht; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L4sA15ZI Received: by mail-qt1-f181.google.com with SMTP id e12so12816344qtr.9 for <~duangle/scopes@lists.sr.ht>; Mon, 29 Jun 2020 06:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:content-transfer-encoding:subject:message-id :user-agent:date:from:to; bh=C9E53SFS/gOEH5qgHb0xbJv7qXnp0jbqfkksH6cDKik=; b=L4sA15ZIbBirZqIeOHRtvT0TFhYFNAgCab00hyfoRiFHmvRYxKFEaFzI5umMh16xnX //YcwWYEiO80k+6jSfY8rvfpMt1ko8E50HMtkxiRXR0PkMchMTaqw0t4NFN6l/mr/wsQ njXlVj+3A7jxk9Ow8m5vXLRIkMk77F6pp+pV082oqssSmzO3cPxOYdzxD21rNoNLZeuu ExuLtl2GoshIq+L5WZsoes3rIiFId0td0XrHsmRuRXuCmpa6j3yJNlHeOcrN4GHf47Vs fnhZMEPXNG5a2CHgm/W8CEZKvGrdv3hIXNUDXXNV5Hh853DlshUYJH4Pyy6ikgfkRsZM R/Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:subject :message-id:user-agent:date:from:to; bh=C9E53SFS/gOEH5qgHb0xbJv7qXnp0jbqfkksH6cDKik=; b=Wh2DJA48giX8o1rJ6dX65/RdZuxTGMIjijFhbVwz5AuRL0JBZKy8XjUDz+xn2/YwJE jHJYAheEA+8hEKbXNA/OTUoE9ECUtw3FiBvIljyZurd+PWIhSkhaCGU4aaa4riRNhIkg F7zLR6aGptHypi8wF5qMauEqmCYwEIvTCofGiKEOiNMiIufO4jV3sxF34NSpStmXX80f jOSsgqzub27Y05XAFOstN2S1P/GCJmQ+JXxFvqWjliveaZLlDEde4tUeS5TxqNCKxI+2 HWZFGz8JtKX/xJTfXFXMlVCuD0fLHrda8JAfuZxqdH27KDIdd/pmRuns9d7OhvdIqf/7 og/w== X-Gm-Message-State: AOAM530fhjyY4R2cmtlyT2mNsvOISETvfnXxEhWtiuBm98w0E4HCTexW 7zrJoBY3CnLOV6sIH/YptWaWrZJsLvs= X-Google-Smtp-Source: ABdhPJzaVYvgX0/v9zP4MR/lF/2f3DJen4HsA0vYcoN5ucEQ6bx6evjbGgJvE2pfzAh72kWR7IecLQ== X-Received: by 2002:ac8:4e48:: with SMTP id e8mr15378294qtw.351.1593438697236; Mon, 29 Jun 2020 06:51:37 -0700 (PDT) Received: from pop-os.localdomain ([2804:d59:26bc:4200:b88e:b6bd:cdb:da03]) by smtp.gmail.com with ESMTPSA id u23sm10950808qkk.53.2020.06.29.06.51.33 for <~duangle/scopes@lists.sr.ht> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 06:51:36 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] prover.cpp: loop merge conflict error now points to loop header as source X-Mercurial-Node: dc6cabdae1088c40fa22da6f9b2ff08be26ed7c0 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: X-Mercurial-Series-Id: User-Agent: Mercurial-patchbomb/5.3.1 Date: Mon, 29 Jun 2020 08:51:05 -0500 From: Westerbly Snaydley To: ~duangle/scopes@lists.sr.ht # HG changeset patch # User Westerbly Snaydley # Date 1593438120 18000 # Mon Jun 29 08:42:00 2020 -0500 # Node ID dc6cabdae1088c40fa22da6f9b2ff08be26ed7c0 # Parent 7fccfb5a02ee7da629d6860fceda7187922ac8c0 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). diff --git a/src/prover.cpp b/src/prover.cpp --- a/src/prover.cpp +++ b/src/prover.cpp @@ -1260,12 +1260,10 @@ SCOPES_TRACE_PROVE_EXPR(loop); 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, arguments_type_from_typed_values(repeat->values), - last_anchor, repeat.anchor())); - last_anchor = repeat.anchor(); + newloop.anchor(), repeat.anchor())); } return TypedValueRef(newloop);