Emit error for function that does not end with a return statement