From 58508c526d6eaf2d10d6f66741f30d2096714a3c Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Mon, 18 Jul 2022 09:34:37 +0800 Subject: [PATCH] cleanup: Remove needless enforce + improve enforce error. --- scip_indexer/SCIPIndexer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scip_indexer/SCIPIndexer.cc b/scip_indexer/SCIPIndexer.cc index c93d27cef1..044324540f 100644 --- a/scip_indexer/SCIPIndexer.cc +++ b/scip_indexer/SCIPIndexer.cc @@ -317,7 +317,6 @@ InlinedVector fromSorbetLoc(const core::GlobalState &gs, core::Loc l r.push_back(start.line - 1); r.push_back(start.column - 1); if (start.line != end.line) { - ENFORCE(false, "None of the occurrence types we emit currently should have multiline ranges"); r.push_back(end.line - 1); } else { ENFORCE(start.column < end.column); @@ -466,9 +465,10 @@ class SCIPState { return false; } auto savedCounter = it->second; - ENFORCE(occ.counter == savedCounter, "cannot have distinct local variable {} at same location {}", - (symbolRoles & scip::SymbolRole::Definition) ? "definitions" : "references", - core::Loc(file, occ.offsets).showRaw(gs)); + ENFORCE(occ.counter == savedCounter, "found distinct local variable {} at same location in {}:\n{}", + (symbolRoles & scip::SymbolRole::Definition) ? "definitions" : "references", file.data(gs).path(), + core::Loc(file, occ.offsets).toString(gs)); + return true; }