mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user