mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] Add a workaround for inability to diagnose name shadowing
Let's cover at least the most common cases - min/max. Fixing the problem requires refactoring of `resolveDeclRefExpr`.
This commit is contained in:
@@ -998,6 +998,9 @@ ConstraintSystem::TypeMatchResult constraints::matchCallArguments(
|
||||
|
||||
auto extraArguments = listener.getExtraneousArguments();
|
||||
if (!extraArguments.empty()) {
|
||||
if (RemoveExtraneousArguments::isMinMaxNameShadowing(cs, locator))
|
||||
return cs.getTypeMatchFailure(locator);
|
||||
|
||||
// First let's see whether this is a situation where a single
|
||||
// parameter is a tuple, but N distinct arguments were passed in.
|
||||
if (AllowTupleSplatForSingleParameter::attempt(
|
||||
|
||||
Reference in New Issue
Block a user