Make resolve and the typechecker check for a main fn of the
correct type This means if a non-library program leaves out the main program, the error gets caught earlier than link. Closes #626.
This commit is contained in:
parent
196753e4c3
commit
f26ca025de
9 changed files with 89 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
import std::str;
|
||||
import std::map;
|
||||
import std::map::hashmap;
|
||||
import std::uint;
|
||||
|
|
@ -187,6 +187,9 @@ fn call_kind_str(call_kind c) -> str {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_main_name(&str[] path) -> bool {
|
||||
str::eq(option::get(std::ivec::last(path)), "main")
|
||||
}
|
||||
//
|
||||
// Local Variables:
|
||||
// mode: rust
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue