by inserting it before we analyze statements, we allow ourselves to
analyze statements *with the data we already have*, for example, we can
now check the return statements' type, and see if it matches with the
functions' declared return type.
this is done via setting CompilationContext.cur_function on insertFn()
- don't just ignore function analysis if its incomplete, do an error
- add scope ids for debug purposes
- add children to parent on Scope.createChild
- types: add validation of if's condition expr type
- types: add scopes to ifs