mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When ClangImporter::Implementation::inferDefaultArgument processes func/method arguments as part of omitNeedlessWordsInFunctionName it processes information about how the typenames for the parameters related to the parameter names to form a parameter names list. The parameter names list is used to determine if the argument label for a function should be clipped based on the typename. So for example a type like NSOrderedCollectionDifferenceCalculationOptions would cause a label ending with "Options" to get clipped so that for instance "withOptions" becomes simply "with". Unfortunately in the context of C++-Interop, the typename for the parameter often resolves to what the type backing the typedef or enum is and not the actual name of the typedef (so `typedef NSUInteger NSOrderedCollectionDifferenceCalculationOptions` resolves to a name of NSUInteger rather than NSOrderedCollectionDifferenceCalculationOptions). This patch seeks to collect a bit more information when processing NS_OPTIONS typedefs and providing that to the calling omitNeedlessWordsInFunctionName to handle more inteligently. In practice this fixes anywhere in Foundatio where `withOptions: NSOrderedCollectionDifferenceCalculationOptions` is used.
2.8 KiB
2.8 KiB