Added special case for writeln/write operators
Refactor check_call function for computing the result type