ImportBase opened the input with a default std::fstream (in|out), which had two consequences: a missing file silently produced an empty module (no error), and a present-but-read-only file failed to open and also loaded as empty. Open the stream read-only (std::ios::in) instead, and expose is_open(). System::Load now builds the importer first, checks is_open(), and throws "cannot open file: <path>" before creating the module — so a failed load surfaces as `load failed: …` and leaves no empty module behind. A read-only but present file now loads correctly. Flip the test that pinned the old silent-empty behaviour to assert the clean failure (error + no module created). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.2 KiB
2.2 KiB