Omit needless words: don't drop the first argument label in initializers.

While there are cases where it makes sense to drop the first argument
label in initializers---when they're primarily conversions---it's an
heuristic that produces poor results (e.g., init(_:) rather than
init(coder:)) more often than not. Thus, remove this heuristic.

Swift SVN r31626
This commit is contained in:
Doug Gregor
2015-09-02 06:21:32 +00:00
parent 6358c9a54f
commit e480ac6525
4 changed files with 7 additions and 10 deletions

View File

@@ -339,11 +339,7 @@ StringRef swift::omitNeedlessWords(StringRef name, StringRef typeName,
// Handle complete name matches.
if (nameWordRevIter == nameWordRevIterEnd) {
// If this is the first parameter, it's okay to drop the name
// entirely.
if (role == NameRole::FirstParameter) return "";
// Otherwise, leave the name alone.
// Leave the name alone.
return name;
}