Skip to content

Commit a6ec370

Browse files
zygoloidjonmeow
andauthored
Turn null return that shouldn't happen into CHECK fail.
Co-authored-by: Jon Ross-Perkins <[email protected]>
1 parent e575ff8 commit a6ec370

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

toolchain/check/cpp/location.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ static auto GetFile(Context& context, SemIR::CheckIRId ir_id)
1818

1919
// If the file is imported, locate it in our imports map.
2020
auto import_id = context.check_ir_map().Get(ir_id);
21-
if (!import_id.has_value()) {
22-
// We never imported this CheckIR.
23-
// TODO: Can this happen?
24-
return nullptr;
25-
}
21+
CARBON_CHECK(import_id.has_value());
2622
return context.import_irs().Get(import_id).sem_ir;
2723
}
2824

0 commit comments

Comments
 (0)