Didn't we already have a check/fail somewhere at some point if a module in a file was misnamed? Or am I making that up? (It could be in dev mode perhaps that we ensure when a module is loaded, a module with the requested id actually gets defined.)

I guess this check covers that case. Maybe we could change the error message to note misnamed module as a possible cause as well?