mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add empty parens to var-to-function renames
This commit is contained in:
@@ -1359,6 +1359,11 @@ void swift::fixItAvailableAttrRename(TypeChecker &TC,
|
||||
baseReplace += '.';
|
||||
}
|
||||
baseReplace += parsed.BaseName;
|
||||
if (parsed.IsFunctionName && parsed.ArgumentLabels.empty() && !call) {
|
||||
// If we're going from a var to a function with no arguments, emit an
|
||||
// empty parameter list.
|
||||
baseReplace += "()";
|
||||
}
|
||||
diag.fixItReplace(referenceRange, baseReplace);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user