slightly better error reporting for mismatched return types