[CodeCompletion] Allow references to top-level functions with error parameters
During normal type-checking we ignore functions that contain an error. During code completion, we want to consider them and replace all error types by placeholders so we can match up the known types.
We already do this for member types (see `getTypeOfMemberReference`). We should also do it for top-level functions.
Fixes rdar://81425383 [SR-14992]
# Conflicts:
# test/IDE/complete_call_arg.swift