I'm attaching a playground file that demonstrates the issue:
Have a function at the file-level:
which includes a name-checking logic which you want to be shared among several components in the file.
Then create class that has the following method:
The compiler complains that there's an extra argument existingAccounts within the call. There is hence no way to address the function outside of the controller class without renaming it. The compiler should consider it as an overload candidate as well. Since self. is not explicitely mentioned, the compiler should use the file-level function.