Revert "Omit needless words: don't drop the first parameter name for failability initializers."

This reverts commit r31431. This isn't a good heuristic.

Swift SVN r31449
This commit is contained in:
Doug Gregor
2015-08-25 14:36:04 +00:00
parent 419fc39309
commit 6e1b8323f7
6 changed files with 9 additions and 25 deletions

View File

@@ -377,8 +377,7 @@ bool swift::omitNeedlessWords(StringRef &baseName,
StringRef resultType,
StringRef contextType,
ArrayRef<StringRef> paramTypes,
bool returnsSelf,
bool failableInitializer) {
bool returnsSelf) {
// For zero-parameter methods that return 'Self' or a result type
// that matches the declaration context, omit needless words from
// the base name.
@@ -406,7 +405,6 @@ bool swift::omitNeedlessWords(StringRef &baseName,
// Omit needless words based on the type of the parameter.
NameRole role = i > 0 ? NameRole::SubsequentParameter
: argNames[0].empty() ? NameRole::BaseName
: failableInitializer ? NameRole::SubsequentParameter
: NameRole::FirstParameter;
StringRef name = role == NameRole::BaseName ? baseName : argNames[i];