Skip to content

Commit fd1e116

Browse files
cleanup: Remove needless enforce + improve enforce error. (#23)
1 parent 3550a70 commit fd1e116

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scip_indexer/SCIPIndexer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ InlinedVector<int32_t, 4> fromSorbetLoc(const core::GlobalState &gs, core::Loc l
317317
r.push_back(start.line - 1);
318318
r.push_back(start.column - 1);
319319
if (start.line != end.line) {
320-
ENFORCE(false, "None of the occurrence types we emit currently should have multiline ranges");
321320
r.push_back(end.line - 1);
322321
} else {
323322
ENFORCE(start.column < end.column);
@@ -466,9 +465,10 @@ class SCIPState {
466465
return false;
467466
}
468467
auto savedCounter = it->second;
469-
ENFORCE(occ.counter == savedCounter, "cannot have distinct local variable {} at same location {}",
470-
(symbolRoles & scip::SymbolRole::Definition) ? "definitions" : "references",
471-
core::Loc(file, occ.offsets).showRaw(gs));
468+
ENFORCE(occ.counter == savedCounter, "found distinct local variable {} at same location in {}:\n{}",
469+
(symbolRoles & scip::SymbolRole::Definition) ? "definitions" : "references", file.data(gs).path(),
470+
core::Loc(file, occ.offsets).toString(gs));
471+
472472
return true;
473473
}
474474

0 commit comments

Comments
 (0)