mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency] Move removal of leading "get" for async imports.
Name adjustments should be performed by omitNeedlessWords(), not the early classifcation of async imports.
This commit is contained in:
@@ -1220,6 +1220,7 @@ bool swift::omitNeedlessWords(StringRef &baseName,
|
||||
bool returnsSelf,
|
||||
bool isProperty,
|
||||
const InheritedNameSet *allPropertyNames,
|
||||
bool isAsync,
|
||||
StringScratchSpace &scratch) {
|
||||
bool anyChanges = false;
|
||||
OmissionTypeName resultType = returnsSelf ? contextType : givenResultType;
|
||||
@@ -1287,6 +1288,14 @@ bool swift::omitNeedlessWords(StringRef &baseName,
|
||||
}
|
||||
}
|
||||
|
||||
// If the base name of a method imported as "async" starts with the word
|
||||
// "get", drop the "get".
|
||||
if (isAsync && camel_case::getFirstWord(baseName) == "get" &&
|
||||
baseName.size() > 3) {
|
||||
baseName = baseName.substr(3);
|
||||
anyChanges = true;
|
||||
}
|
||||
|
||||
// If needed, split the base name.
|
||||
if (!argNames.empty() &&
|
||||
splitBaseName(baseName, argNames[0], paramTypes[0], firstParamName))
|
||||
|
||||
Reference in New Issue
Block a user