Skip to content

cleanup: Remove needless enforce + improve enforce error. #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scip_indexer/SCIPIndexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ InlinedVector<int32_t, 4> 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);
Expand Down Expand Up @@ -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;
}

Expand Down