Add empty parens to var-to-function renames

This commit is contained in:
Harlan Haskins
2016-08-02 17:33:13 -07:00
parent d1206387c3
commit a99ca851df
3 changed files with 22 additions and 2 deletions

View File

@@ -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);
}