nac3standalone: report when entry point run function cannot be found

polymorphism_fixes
ychenfo 2021-11-11 23:44:57 +08:00
parent d336200bf4
commit aae9925014
1 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,11 @@ fn main() {
let instance = {
let defs = top_level.definitions.read();
let mut instance = defs[resolver.get_identifier_def("run".into()).unwrap().0].write();
let mut instance =
defs[resolver
.get_identifier_def("run".into())
.unwrap_or_else(|| panic!("cannot find `run() -> int32 entry point`")).0
].write();
if let TopLevelDef::Function {
instance_to_stmt,
instance_to_symbol,