Existential Any migration Script

Hi everyone, I'm migrating Existential Any for my project to prepare for the Swift 6. I would like to ask you guys if there's any script or tool to automatically add any keyword. Thank you in advance!

1 Like

It’s possible SwiftLint or SwiftFormat have something for this.

1 Like

A script like this would require access to full type information (right?), which SwiftFormat and SwiftLint don't have unfortunately. If these tools had access to type information it would unlock a ton of new possibilities.

2 Likes

SwiftLint has a few so called Analyzer Rules which intercept the build process to extract type information. Implementing such a rule to add any to protocol types would be possible. It would have quite a long runtime. But that might be acceptable for an action applied only once.

What’s harder to figure out is where some would be equally appropriate.

1 Like

Actually, SwiftLint has integrated SwiftSyntax 3,5 years ago, so SwiftLint rules should now have access to the full syntax tree.

In my own code, I found that a lot of uses of any Foo could have actually been some Foo, so I don't think a bulk find-and-replace script or linter rule would be a good idea. You would be missing an opportunity to vet your code and remove existential containers from places where they were never really necessary.

Instead, I'd suggest using -enable-upcoming-feature ExistentialAny (see Using Upcoming Feature Flags for instructions) . This will make the compiler report any bare uses of a protocol without any, which you can then manually vet and update.

7 Likes

You could just do it in two phases: first to some Protocol, then manually fix (or apply compiler fixits) any cases where any is required.

2 Likes

The syntax tree, as its name implies, is only about syntax. Type information is a totally different topic.

3 Likes

My bad, for some reason I thought this might be part of the syntax tree as well, but you're absolutely right that it isn't.

2 Likes

This is a good question, quite a lot of code is going to need to be updated for this aspect of Swift 6 and it's not as simple as just adding any as you would be missing out on the subtle advantages of using some, opaque types.

There is, just enough information available using SourceKit to to identify where protocols are being referenced in source so I've written a small Swift "script" to attempt to help automate this conversion.

It follows the following:

There are a few extra edge cases handled using regular expressions and system protocol references are always elided to any to avoid breaking conformances. The script follows up by using the compiler with option -enable-upcoming-feature ExistentialAny to pick up any remaining missing anys and patches them in.

There will always be a few remaining errors to fix manually but it's working reasonably well. The results so far compiling the most popular Swift packages showing the deduplicated number of compilation errors compiling for option ExistentialAny before and after running the script are below.

repos/<rank>_<stars>_<name> ... #errors
repos/0001_37713_Alamofire/AFTER.txt      10
repos/0001_37713_Alamofire/BEFORE.txt     363
repos/0002_35061_fastlane/AFTER.txt       7
repos/0002_35061_fastlane/BEFORE.txt       7
repos/0003_25532_Charts/AFTER.txt      52
repos/0003_25532_Charts/BEFORE.txt     199
repos/0004_24159_SDWebImage/AFTER.txt       0
repos/0004_24159_SDWebImage/BEFORE.txt       0
repos/0005_22763_lottie-ios/BEFORE.txt       0
repos/0006_22232_RxSwift/AFTER.txt      26
repos/0006_22232_RxSwift/BEFORE.txt     761
repos/0007_21791_vapor/AFTER.txt       2
repos/0007_21791_vapor/BEFORE.txt       2
repos/0008_21366_SwiftyJSON/AFTER.txt       3
repos/0008_21366_SwiftyJSON/BEFORE.txt       8
repos/0009_20837_Hero/AFTER.txt       0
repos/0009_20837_Hero/BEFORE.txt       0
repos/0010_20172_Kingfisher/AFTER.txt      18
repos/0010_20172_Kingfisher/BEFORE.txt     109
repos/0011_18528_SnapKit/AFTER.txt       0
repos/0011_18528_SnapKit/BEFORE.txt      39
repos/0012_16168_SwiftLint/BEFORE.txt       0
repos/0013_15620_IQKeyboardManager/AFTER.txt       3
repos/0013_15620_IQKeyboardManager/BEFORE.txt       3
repos/0014_15353_realm-swift/AFTER.txt      17
repos/0014_15353_realm-swift/BEFORE.txt     235
repos/0015_14594_carthage/AFTER.txt       2
repos/0015_14594_carthage/BEFORE.txt       2
repos/0016_13989_Moya/AFTER.txt      62
repos/0016_13989_Moya/BEFORE.txt      62
repos/0017_13873_perfect/AFTER.txt       0
repos/0017_13873_perfect/BEFORE.txt       9
repos/0018_13854_PromiseKit/AFTER.txt       0
repos/0018_13854_PromiseKit/BEFORE.txt      24
repos/0019_13694_fmdb/AFTER.txt       0
repos/0019_13694_fmdb/BEFORE.txt       0
repos/0020_12703_CocoaLumberjack/AFTER.txt       2
repos/0020_12703_CocoaLumberjack/BEFORE.txt       2
repos/0021_12409_IGListKit/AFTER.txt       4
repos/0021_12409_IGListKit/BEFORE.txt       3
repos/0022_12209_CocoaAsyncSocket/AFTER.txt       0
repos/0022_12209_CocoaAsyncSocket/BEFORE.txt       0
repos/0023_11443_Eureka/AFTER.txt       3
repos/0023_11443_Eureka/BEFORE.txt       3
repos/0024_11225_SkeletonView/AFTER.txt       3
repos/0024_11225_SkeletonView/BEFORE.txt       3
repos/0025_11197_SwifterSwift/AFTER.txt       3
repos/0025_11197_SwifterSwift/BEFORE.txt      10
repos/0026_10141_NVActivityIndicatorView/AFTER.txt       0
repos/0026_10141_NVActivityIndicatorView/BEFORE.txt       0
repos/0027_9447_Quick/AFTER.txt       0
repos/0027_9447_Quick/BEFORE.txt       5
repos/0028_9173_AudioKit/AFTER.txt       0
repos/0028_9173_AudioKit/BEFORE.txt     150
repos/0029_9100_CryptoSwift/AFTER.txt      16
repos/0029_9100_CryptoSwift/BEFORE.txt      65
repos/0030_8962_ObjectMapper/AFTER.txt       0
repos/0030_8962_ObjectMapper/BEFORE.txt      20
repos/0031_8800_swift-package-manager/AFTER.txt       1
repos/0031_8800_swift-package-manager/BEFORE.txt       1
repos/0032_8687_R.swift/AFTER.txt       2
repos/0032_8687_R.swift/BEFORE.txt       2
repos/0033_8620_IBAnimatable/AFTER.txt       3
repos/0033_8620_IBAnimatable/BEFORE.txt       3
repos/0034_8286_SQLite.swift/AFTER.txt      40
repos/0034_8286_SQLite.swift/BEFORE.txt     265
repos/0035_7972_swiftgen/AFTER.txt      10
repos/0035_7972_swiftgen/BEFORE.txt      10
repos/0036_7611_Reachability.swift/AFTER.txt       0
repos/0036_7611_Reachability.swift/BEFORE.txt       0
repos/0037_7572_PureLayout/AFTER.txt       0
repos/0037_7572_PureLayout/BEFORE.txt       0
repos/0038_7529_Kitura/AFTER.txt       2
repos/0038_7529_Kitura/BEFORE.txt       2
repos/0039_7332_Starscream/AFTER.txt       0
repos/0039_7332_Starscream/BEFORE.txt      69
repos/0040_7295_Cartography/AFTER.txt      19
repos/0040_7295_Cartography/BEFORE.txt     104
repos/0041_7206_ReSwift/AFTER.txt       7
repos/0041_7206_ReSwift/BEFORE.txt      14
repos/0042_7187_JTAppleCalendar/AFTER.txt       3
repos/0042_7187_JTAppleCalendar/BEFORE.txt       3
repos/0043_7150_JVFloatLabeledTextField/AFTER.txt       2
repos/0043_7150_JVFloatLabeledTextField/BEFORE.txt       2
repos/0044_7087_facebook-ios-sdk/BEFORE.txt       0
repos/0045_7001_swift-nio/AFTER.txt       2
repos/0045_7001_swift-nio/BEFORE.txt       2
repos/0046_6939_RIBs/AFTER.txt      14
repos/0046_6939_RIBs/BEFORE.txt      14
repos/0047_6932_SwiftDate/AFTER.txt      31
repos/0047_6932_SwiftDate/BEFORE.txt      96
repos/0048_6922_KeychainAccess/AFTER.txt       0
repos/0048_6922_KeychainAccess/BEFORE.txt       5
repos/0049_6745_ViewAnimator/AFTER.txt       3
repos/0049_6745_ViewAnimator/BEFORE.txt       3
repos/0050_6703_Nuke/AFTER.txt      40
repos/0050_6703_Nuke/BEFORE.txt     113
repos/0051_6624_sourcery/AFTER.txt       2
repos/0051_6624_sourcery/BEFORE.txt       2
repos/0052_6545_SwiftMessages/AFTER.txt       3
repos/0052_6545_SwiftMessages/BEFORE.txt       3
repos/0053_6505_FSPagerView/AFTER.txt       3
repos/0053_6505_FSPagerView/BEFORE.txt       3
repos/0054_6300_swift-composable-architecture/AFTER.txt       2
repos/0054_6300_swift-composable-architecture/BEFORE.txt       2
repos/0055_6209_DTCoreText/AFTER.txt       1
repos/0055_6209_DTCoreText/BEFORE.txt       1
repos/0056_6117_KIF/AFTER.txt       4
repos/0056_6117_KIF/BEFORE.txt       4
repos/0057_6075_AMScrollingNavbar/AFTER.txt       3
repos/0057_6075_AMScrollingNavbar/BEFORE.txt       3
repos/0058_5992_SwiftyStoreKit/AFTER.txt       6
repos/0058_5992_SwiftyStoreKit/BEFORE.txt      56
repos/0059_5915_Sparkle/BEFORE.txt       0
repos/0060_5877_SwiftEntryKit/AFTER.txt       3
repos/0060_5877_SwiftEntryKit/BEFORE.txt       3
repos/0061_5851_swipecellkit/AFTER.txt       3
repos/0061_5851_swipecellkit/BEFORE.txt       3
repos/0062_5839_macaw/AFTER.txt       2
repos/0062_5839_macaw/BEFORE.txt       2
repos/0063_5763_SwiftFormat/AFTER.txt       0
repos/0063_5763_SwiftFormat/BEFORE.txt      19
repos/0064_5506_SwiftyBeaver/AFTER.txt       0
repos/0064_5506_SwiftyBeaver/BEFORE.txt      30
repos/0065_5481_XcodeGen/AFTER.txt      10
repos/0065_5481_XcodeGen/BEFORE.txt      10
repos/0066_5354_SideMenu/AFTER.txt       3
repos/0066_5354_SideMenu/BEFORE.txt       3
repos/0067_5298_Swinject/AFTER.txt       5
repos/0067_5298_Swinject/BEFORE.txt      76
repos/0068_5191_MessageKit/BEFORE.txt       0
repos/0069_5150_GRDB.swift/AFTER.txt      15
repos/0069_5150_GRDB.swift/BEFORE.txt     112
repos/0070_4997_Surge/AFTER.txt       0
repos/0070_4997_Surge/BEFORE.txt       0
repos/0071_4949_FloatingPanel/AFTER.txt       3
repos/0071_4949_FloatingPanel/BEFORE.txt       3
repos/0072_4941_PermissionsKit/AFTER.txt       3
repos/0072_4941_PermissionsKit/BEFORE.txt       3
repos/0073_4891_OHHTTPStubs/AFTER.txt       0
repos/0073_4891_OHHTTPStubs/BEFORE.txt       3
repos/0074_4862_Instructions/AFTER.txt       3
repos/0074_4862_Instructions/BEFORE.txt       3
repos/0075_4802_socket.io-client-swift/AFTER.txt       3
repos/0075_4802_socket.io-client-swift/BEFORE.txt       3
repos/0076_4744_gpuimage2/AFTER.txt       0
repos/0076_4744_gpuimage2/BEFORE.txt      29
repos/0077_4742_ESTabBarController/AFTER.txt       3
repos/0077_4742_ESTabBarController/BEFORE.txt       3
repos/0078_4726_SwiftUIX/AFTER.txt     101
repos/0078_4726_SwiftUIX/BEFORE.txt     101
repos/0079_4648_SwiftyUserDefaults/AFTER.txt       0
repos/0079_4648_SwiftyUserDefaults/BEFORE.txt       7
repos/0080_4617_async/AFTER.txt       0
repos/0080_4617_async/BEFORE.txt       0
repos/0081_4542_PhoneNumberKit/AFTER.txt       0
repos/0081_4542_PhoneNumberKit/BEFORE.txt       7
repos/0082_4462_Advance/AFTER.txt       0
repos/0082_4462_Advance/BEFORE.txt       0
repos/0083_4451_Nimble/AFTER.txt      21
repos/0083_4451_Nimble/BEFORE.txt      84
repos/0084_4405_AnimatedCollectionViewLayout/AFTER.txt       3
repos/0084_4405_AnimatedCollectionViewLayout/BEFORE.txt       3
repos/0085_4382_chartview/AFTER.txt       3
repos/0085_4382_chartview/BEFORE.txt       3
repos/0086_4381_swift-algorithms/AFTER.txt       0
repos/0086_4381_swift-algorithms/BEFORE.txt       0
repos/0087_4215_EFQRCode/AFTER.txt       0
repos/0087_4215_EFQRCode/BEFORE.txt       7
repos/0088_4212_bond/AFTER.txt       2
repos/0088_4212_bond/BEFORE.txt       2
repos/0089_4188_SVGKit/AFTER.txt       8
repos/0089_4188_SVGKit/BEFORE.txt       8
repos/0090_4101_Bagel/AFTER.txt       1
repos/0090_4101_Bagel/BEFORE.txt       1
repos/0091_4089_ActiveLabel.swift/AFTER.txt       3
repos/0091_4089_ActiveLabel.swift/BEFORE.txt       3
repos/0092_4019_Publish/AFTER.txt       2
repos/0092_4019_Publish/BEFORE.txt       2
repos/0093_3984_Siren/AFTER.txt       3
repos/0093_3984_Siren/BEFORE.txt       3
repos/0094_3959_SkyFloatingLabelTextField/AFTER.txt       3
repos/0094_3959_SkyFloatingLabelTextField/BEFORE.txt       3
repos/0095_3880_swift-protobuf/AFTER.txt      11
repos/0095_3880_swift-protobuf/BEFORE.txt     167
repos/0096_3840_Then/AFTER.txt       0
repos/0096_3840_Then/BEFORE.txt       0
repos/0097_3827_KSCrash/AFTER.txt       3
repos/0097_3827_KSCrash/BEFORE.txt       3
repos/0098_3827_MarqueeLabel/AFTER.txt       3
repos/0098_3827_MarqueeLabel/BEFORE.txt       3
repos/0099_3818_AlamofireImage/AFTER.txt      48
repos/0099_3818_AlamofireImage/BEFORE.txt      48
5 Likes

I've taken this idea a bit further, testing a broader range of code and added an app target that you can use to open a Package.swift and try the conversion out. Results continue to be good, sometimes dramatically so (the numbers suggest I may be able to save the maintainer of RxSwift towards 2000 edits) and the approach of patching the code to review and test before committing seems sound.

If you don't find the idea of automated migration attractive it is a very conservative implementation, deliding (the opposite of eliding?) to some only for procedure arguments. Initialised storage tends to be a non-issue as type inference will look after the type anyway and uninitialised variables and properties particularly if they are var I'd argue you generally wouldn't want to be using an opaque some type.

Results of last nights run (before/after are the number of errors compiling in mode ExistentialAny), and edits is the number of individual changes that needed to be made to the project sources.

                                              #errors            elided
#rank                          name (stars) before after edits  any some (approx)
#---- ------------------------------------- ------ ----- ----- ---- ----
#0000                   NetNewsWire (7265*)     17     1   429  280  149
#0001                    Alamofire (37713*)   2009     0   392  344   50
#0002                     fastlane (35061*)     63     0     7    4    3
#0003                       Charts (25532*)   3698     0   196  172   24
#0004                   SDWebImage (24159*)      0     0     0    0    0
#0005                   lottie-ios (22763*)   9228     0   379  338   41
#0006                      RxSwift (22232*)  16182     4  1904 1479  523
#0007                        vapor (21791*)     40     8   434  313  124
#0008                   SwiftyJSON (21366*)     16     0    10    9    1
#0009                         Hero (20837*)      0     0    13   11    2
#0010                   Kingfisher (20172*)    964     2   105   92   15
#0011                      SnapKit (18528*)    221     0    39   12   27
#0012                    SwiftLint (16168*)   1013    44   216  182   34
#0013            IQKeyboardManager (15620*)     26    26     2    2    0
#0014                  realm-swift (15353*)   1723    18   274  253   21
#0015                     carthage (14594*)     47    14    15   12    3
#0016                         Moya (13989*)  13565   126    86   58   30
#0017                      perfect (13873*)     14     0     7    7    0
#0018                   PromiseKit (13854*)     73     0    45   45    0
#0019                         fmdb (13694*)      0     0     0    0    0
#0020              CocoaLumberjack (12703*)     52     4     3    2    1
#0021                    IGListKit (12409*)      4     1     6    5    1
#0022             CocoaAsyncSocket (12209*)      0     0     2    2    0
#0023                       Eureka (11443*)     70    70    28   25    3
#0024                 SkeletonView (11225*)     64    64    11   11    0
#0025                 SwifterSwift (11197*)    119     0    10    9    1
#0026      NVActivityIndicatorView (10141*)      0     0     6    6    0
#0027                         Quick (9447*)     26     0     2    2    0
#0028                      AudioKit (9173*)   2660     0   152   94   58
#0029                   CryptoSwift (9100*)    934     0    57   41   16
#0030                  ObjectMapper (8962*)     70     0    22   22    0
#0031         swift-package-manager (8800*)      1     1   871  603  270
#0032                       R.swift (8687*)    138    70    19   16    3
#0033                  IBAnimatable (8620*)    174   174     7    6    1
#0034                  SQLite.swift (8286*)   1344    45   243  193   59
#0035                      swiftgen (7972*)   1007    84   139  118   21
#0036            Reachability.swift (7611*)      0     0     0    0    0
#0037                    PureLayout (7572*)      0     0     0    0    0
#0038                        Kitura (7529*)     14   135   181  162   21
#0039                    Starscream (7332*)    238     0    77   58   20
#0040                   Cartography (7295*)    468    34    71   46   36
#0041                       ReSwift (7206*)     37     7    27   12   15
#0042               JTAppleCalendar (7187*)     26    26    18   15    3
#0043       JVFloatLabeledTextField (7150*)      2     2     0    0    0
#0044              facebook-ios-sdk (7087*)      0     0   428  345   86
#0045                     swift-nio (7001*)     10    24  1186  937  262
#0046                          RIBs (6939*)  16182     4   592  349  248
#0047                     SwiftDate (6932*)    464    34    79   44   41
#0048                KeychainAccess (6922*)      8     0    31   30    1
#0049                  ViewAnimator (6745*)     10    10     6    6    0
#0050                          Nuke (6703*)    905     0   120   93   28
#0051                      sourcery (6624*)    223  1149   124   94   31
#0052                 SwiftMessages (6545*)     35    35    38   26   12
#0053                   FSPagerView (6505*)     10    10     2    2    0
#0054 swift-composable-architecture (6300*)     32    71   136  124   13
#0055                    DTCoreText (6209*)      1     1     0    0    0
#0056                           KIF (6117*)      2     4     0    0    0
#0057             AMScrollingNavbar (6075*)      6     6     2    2    0
#0058                SwiftyStoreKit (5992*)    158     7    48   33   18
#0059                       Sparkle (5915*)      1     1     6    6    0
#0060                 SwiftEntryKit (5877*)     71    71     6    3    3
#0061                  swipecellkit (5851*)     25    25    19   15    4
#0062                         macaw (5839*)      7    22     9    8    1
#0063                   SwiftFormat (5763*)     61     0   123  102   21
#0064                  SwiftyBeaver (5506*)     63     0    26   22    4
#0065                      XcodeGen (5481*)    281    23    26   21    5
#0066                      SideMenu (5354*)     17    17     9    8    1
#0067                      Swinject (5298*)    271     5   114   90   24
#0068                    MessageKit (5191*)     37     3   262   48  214
#0069                    GRDB.swift (5150*)   2106    28   203  203    0
#0070                         Surge (4997*)      0     0     0    0    0
#0071                 FloatingPanel (4949*)     18    18    82   77    5
#0072                PermissionsKit (4941*)      6     6     3    3    0
#0073                   OHHTTPStubs (4891*)      4     0     1    1    0
#0074                  Instructions (4862*)     52    52    32   31    1
#0075        socket.io-client-swift (4802*)    235     0    44   39    5
#0076                     gpuimage2 (4744*)    549     0    41   18   23
#0077            ESTabBarController (4742*)     10    10     1    1    0
#0078                      SwiftUIX (4726*)   2519    15   130  124    7
#0079            SwiftyUserDefaults (4648*)     15     0     6    6    0
#0080                         async (4617*)      0     0     0    0    0
#0081                PhoneNumberKit (4542*)     20     0     6    6    0
#0082                       Advance (4462*)      0     0     2    2    0
#0083                        Nimble (4451*)    656     2    84   77    7
#0084  AnimatedCollectionViewLayout (4405*)     13    13     3    3    0
#0085                     chartview (4382*)      5     3     0    0    0
#0086              swift-algorithms (4381*)      0     0     0    0    0
#0087                      EFQRCode (4215*)     22     0     6    5    1
#0088                          bond (4212*)    571   157    60   60    0
#0089                        SVGKit (4188*)     15    15     0    0    0
#0090                         Bagel (4101*)      1     3     2    2    0
#0091             ActiveLabel.swift (4089*)      8     8     1    1    0
#0092                       Publish (4019*)    357     5    55   51    4
#0093                         Siren (3984*)     24    24     2    2    0
#0094     SkyFloatingLabelTextField (3959*)      6     6    26    1   25
#0095                swift-protobuf (3880*)   1943     2  3062 2981   82
#0096                          Then (3840*)      0     0     0    0    0
#0097                       KSCrash (3827*)      3     0     0    0    0
#0098                  MarqueeLabel (3827*)      4     4     7    6    1
#0099                AlamofireImage (3818*)   1756     0    65   57    8
#0100               TinyConstraints (3790*)     48     0    24    2   22
#0101                     XCGLogger (3754*)     80     0    20   15    5
#0102                         Valet (3751*)      0     0     0    0    0
#0103                    SwiftWebUI (3751*)     10    24   245  155   90
#0104                     DeviceKit (3693*)      4     4     0    0    0
#0105              firebase-ios-sdk (3653*)    310   160   459  425   36
#0106                      promises (3640*)     81     0    45   45    0
#0107                       swifter (3536*)     18     0     6    6    0
#0108                          Argo (3497*)      3     3     0    0    0
#0109                     CoreStore (3431*)   7085   649   443  417   27
#0110                     periphery (3412*)    137    13    77   64   13
#0111                    apollo-ios (3365*)     32   259   814  709  108
#0112                     SwiftSoup (3363*)     42     0     5    2    3
#0113                        Swiftz (3319*)      0     0     0    0    0
#0114                     RNCryptor (3305*)      7     0     3    3    0
#0115              BubbleTransition (3290*)      4     4     0    0    0
#0116                      PanModal (3281*)     16    16    19   15    4
#0117                        BonMot (3269*)    172     2    46   43    3
#0118                        Stevia (3250*)      0     0     2    2    0
#0119            SwiftUI-Introspect (3193*)      0     0     0    0    0
#0120                   Toast-Swift (3147*)      4     4     0    0    0
#0121                 DifferenceKit (3130*)     11     0     3    1    2
#0122                 UIImageColors (3094*)      0     0     0    0    0
#0123              InAppSettingsKit (3094*)      1     5     0    0    0
#0124                 SwiftLocation (3082*)    336     0    61   50   11
#0125                MagazineLayout (3076*)     29    29     6    3    3
#0126                    OAuthSwift (3008*)    376     0    54   48   18
#0127                      fengniao (2958*)     20     0     4    4    0
#0128                        nanopb (2948*)      0     0     0    0    0
#0129                      AMPopTip (2915*)      6     6    59   50    9
#0130                 RxDataSources (2879*)   5069     4     2    2    0
#0131             LNPopupController (2857*)      7     4     0    0    0
#0132                  URLNavigator (2853*)     10     0    42   20   29
#0133                 AloeStackView (2849*)     10    10     0    0    0
#0134                 ReactiveSwift (2841*)   1105    54   162  123   39
#0135                      Reusable (2822*)      0     0     0    0    0
#0136                Localize-Swift (2819*)      8     8    10   10    0
#0137               SwiftRichString (2809*)    205     0    55   49    6
#0138                          Gifu (2777*)      0     0     2    1    1
#0139                         tuist (2756*)     52     4  1450 1077  373
#0140                  DynamicColor (2746*)      0     0     0    0    0
#0141             TwitterTextEditor (2722*)     21    21    50   44    8
#0142                     swift-log (2721*)     52     4    30   29    1
#0143               LifetimeTracker (2675*)     20    20     3    2    1
#0144         swift-argument-parser (2668*)    985     0   274  273    5
#0145                    Brightroom (2665*)      2     2     7    6    1
#0146                     Timepiece (2653*)      0     0     0    0    0
#0147        swift-snapshot-testing (2647*)    220     6    36   36    0
#0148                         Cache (2597*)     88     0    15   15    0
#0149                   WhatsNewKit (2542*)    101     0    11   10    1
#0150                   reel-search (2539*)     12    12     7    5    2
#0151                        Result (2524*)     27     0    11   11    0
#0152               plcrashreporter (2446*)      0     0     0    0    0
#0153                       Swifter (2396*)     50     0     8    7    1
#0154                   SwiftCharts (2396*)    119   119    96   83   16
#0155                        Tabman (2373*)     28    28    75   35   40
#0156                    ReactorKit (2367*)  15962     4    13   11    2
#0157                     Segmentio (2365*)     16    16     0    0    0
#0158              HaishinKit.swift (2310*)     28    74    39   39    0
#0159             swift-collections (2310*)    164     0    90   90    0
#0160                         files (2284*)     18     0     8    8    0
#0161          SimulatorStatusMagic (2274*)      8     8     0    0    0
#0162                         Kanna (2263*)    107     0    54   46    8
#0163                       FileKit (2218*)    162     0    17   17    0
#0164                       carekit (2215*)     36   137   481  360  152
#0165                keychain-swift (2211*)      0     0     0    0    0
#0166                           Zip (2196*)      0     0     0    0    0
#0167                   OpenCombine (2190*)   3127    26   425  294  131
#0168                        Render (2161*)      7     3     6    6    0
#0169                        siesta (2159*)      1     1   137  102   36
#0170                   CalendarKit (2142*)     39    39    46   28   18
#0171                       Stencil (2132*)      8     9   126  114   15
#0172               HorizonCalendar (2125*)     48    48    35   28    7
#0173                           Ink (2112*)    122     0     6    6    0
#0174   CollectionViewSlantedLayout (2101*)     12    12     0    0    0
#0175                      Wormholy (2070*)      1     1     7    7    0
#0176                        ocmock (2067*)      0     0     1    1    0
#0177                  SourceKitten (2063*)    965   324    95   89    6
#0178                       APNGKit (2033*)     45     0    15   12    3
#0179                          time (2013*)    256     2    33   25    8
#0180                     NextLevel (1991*)     16    16    26   25    1
#0181                     PinLayout (1979*)    462     0   118   90   28
#0182                         Hydra (1972*)     88     0    18   18    0
#0183                          Down (1957*)    249     3    34   26    8
#0184                        Player (1927*)      4     4     6    6    0
#0185                     EasyPeasy (1909*)     18     4     4    3    1
#0186                        APIKit (1909*)    125     0    39   35    4
#0187                 BrightFutures (1900*)      6     9     9    9    0
#0188                  XCoordinator (1869*)   2346    48    92   67   28
#0189                          Mint (1861*)    410    19     5    5    0
#0190                          zewo (1860*)     14    14   127   96   31
#0191    CollectionViewPagingLayout (1851*)     37    37    19   17    2
#0192                 ZIPFoundation (1839*)      8     0     3    3    0
#0193                        Dwifft (1838*)      0     0     0    0    0
#0194                  swift-syntax (1831*)   2112   360   238  187   85
#0195                      Watchdog (1820*)      0     0     0    0    0
#0196                swift-markdown (1798*)   1769     5   119   86   34
#0197                        xcodes (1786*)     81     0    26   22    4
#0198                          Plot (1779*)   1107     5   117   80   38
#0199                      Resolver (1770*)      2     0    48   46    2
#0200                      SwiftSVG (1764*)    317     0    46   46    0
#0201                      Schedule (1755*)      4     0     1    1    0
#0202                       Pageboy (1730*)     28    28     6    5    1
#0203                 WaterfallGrid (1716*)      0     0     1    1    1
#0204                       Tokamak (1707*)      1     1   200  176   28
#0205                       Cleanse (1697*)   1158     0   394  374   24
#0206                     swift-doc (1687*)      6    12    22   20    3
#0207                        RxFlow (1680*)  15962     4   111   51   63
#0208                       Rainbow (1668*)      4     0     1    1    0
#0209                ImageSlideshow (1647*)      1     1    12   12    1
#0210                         Gloss (1643*)     34     0    14   14    0
#0211                    stripe-ios (1640*)      1     3   993  736  259
#0212                      swift-sh (1634*)    122     0     4    4    0
#0213                   SwiftMoment (1634*)      0     0     0    0    0
#0214               pull-to-refresh (1621*)     11    11     7    4    3
#0215                        Fakery (1606*)      0    12     3    1    2
#0216                     xcodeproj (1606*)     13     0    35   35    0
#0217                       SPAlert (1600*)     16    16     0    0    0
#0218        ios-snapshot-test-case (1598*)      6     4     0    0    0
#0219                     SwiftyGif (1587*)     17     0    10   10    0
#0220                     Runestone (1569*)      1     1    62   49   13
#0221                        Splash (1558*)     34     0     8    6    2
#0222                  swift-format (1553*)      1     1    17    9    8
#0223                    grpc-swift (1537*)     10    47  1166  911  256
#0224                   RxAlamofire (1537*)  15048     4   134   76   58
#0225                        themis (1533*)      1     1     0    0    0
#0226             FontAwesome.swift (1531*)     20    15     2    2    0
#0227                     pocketsvg (1521*)      0     0     0    0    0
#0228                  Connectivity (1514*)     34     0    10    9    1
#0229                        Venice (1499*)     14    14     3    3    0
#0230                     Commander (1494*)    406   127   141  135    6
#0231        swift-async-algorithms (1489*)     41     2   165  159    6
#0232          SwiftKeychainWrapper (1476*)      7     0     3    3    0
#0233                        Panels (1474*)     10    10     5    4    1
#0234                       appicon (1464*)    729     0     1    1    0
#0235                         qgrid (1451*)      0     0     0    0    0
#0236                   XCLogParser (1450*)   1121     5    21   11   10
#0237                        Repeat (1437*)      6     0     2    2    0
#0238                     Validator (1436*)     26    26    24   13   11
#0239                  Sheeeeeeeeet (1422*)     87    87    13   10    3
#0240                   Codextended (1422*)      6     0     2    2    0
#0241                        Floaty (1418*)     10    10     1    1    0
#0242                SwiftyMarkdown (1410*)     45     4    48   44    4
#0243                swift-numerics (1397*)      8     0     2    2    0
#0244                    RxKeyboard (1396*)  15424     4     0    0    0
#0245                      Magnetic (1394*)    101    99     1    1    0
#0246             SDWebImageSwiftUI (1392*)     45    21    18   18    4
#0247                   SwiftTweaks (1377*)     49    49    35   25   13
#0248                          Just (1374*)     36     0    14    3   11
#0249                    SwiftCheck (1368*)    152     0    52   21   31
#0250            MKRingProgressView (1352*)      6     6     1    1    0
#0251                       PathKit (1347*)      8     0     3    1    2
#0252                   AppAuth-iOS (1344*)      0     0     1    1    0
#0253 IBPCollectionViewCompositionalLayout (1344*)      6     4     6    2    4
#0254                      GEOSwift (1344*)    328     0    63   25   38
#0255                 purchases-ios (1335*)      3     3   409  317   92
#0256               cleanroomlogger (1320*)    392     0    53   51    2
#0257                 BetterCodable (1316*)    125     0    26   26    0
#0258                        Willow (1311*)     46     0    46   38    8
#0259                UIFontComplete (1309*)      7     7     0    0    0
#0260                RxBluetoothKit (1308*)  14603   846   147  121   26
#0261                    Networking (1306*)      0     0     0    0    0
#0262                    Highlightr (1304*)      4     0     1    1    0
#0263                    BlueSocket (1303*)      4     0     9    9    0
#0264                 SwiftUICharts (1301*)     11     0     3    2    1
#0265               smoke-framework (1299*)     40    13    65   53   17
#0266                     CocoaMQTT (1288*)    490     3    95   54   48
#0267                     SWXMLHash (1281*)     13     0     3    3    0
#0268                      Burritos (1273*)      4     4     0    0    0
#0269            QRCodeReader.swift (1265*)     13    13     5    5    0
#0270                     Attabench (1257*)     15   174    21   19    2
#0271                         BTree (1249*)      0     0     0    0    0
#0272                          Ease (1245*)     17    11     1    1    0
#0273                     RxGesture (1243*)  15962     4     0    0    0
#0274                 CameraManager (1240*)      4     4     2    2    0
#0275                 ViewInspector (1230*)   2289   494   134  112   41
#0276                  SubtleVolume (1211*)      4     4     1    1    0
#0277        CenteredCollectionView (1211*)      4     4     1    1    0
#0278                  swift-crypto (1207*)      9     0    23   23    0
#0279                    RxSwiftExt (1205*)  15962     4    13   13    0
#0280              ASCollectionView (1203*)     11    46    14   14    0
#0281                   ReactiveKit (1202*)    576   167    83   60   23
#0282                   BartyCrouch (1196*)   7287    34     8    5    3
#0283                  CombineCocoa (1192*)     28    28     0    0    0
#0284                       Cluster (1191*)     77    17    36   24   12
#0285                    CombineExt (1181*)     74     3    18   18    0
#0286                   WSTagsField (1172*)      8     8     0    0    0
#0287                        mapper (1171*)      0     0     0    0    0
#0288                 DynamicButton (1166*)     36    36     5    4    1
#0289                 SFSafeSymbols (1165*)      0     0     0    0    0
#0290                        fluent (1151*)     36     8    30   24    6
#0291                         euler (1150*)      0     0     0    0    0
#0292                         Guaka (1145*)     14     0    20   19    1
#0293                        Sitrep (1140*)   8324  2822     5    4    1
#0294                      Aperture (1134*)     14    11     4    4    0
#0295                   Preferences (1129*)     52     2    19   19    0
#0296                FDWaveformView (1115*)      6     6     1    1    0
#0297                        Motion (1104*)     19     0     7    6    1
#0298                       RxRealm (1091*)  15962     4    16   16    0
#0299                    Atributika (1087*)     94     0    51   33   18

If one was to draw a side conclusion this rather validates the idea that "smart" eliding to mostly any but some for plain procedure arguments seems to offer very good source compatibility if it were to be pitched and implemented in the compiler. The majority of declarations are procedure arguments which will generally be best as some opaque types. It's difficult to justify such an approach I guess being neither here nor there but it's currently my preference to lessen the impact of the currently envisioned Swift 6. If nobody takes this path at least people will have this script to help the migration. Converting an app such as NetNewsWire rather than packages is still a work in progress due to complications with xcodebuild.

A couple of observations I made along the way if anybody from Apple has read this far:

  • The new ExistentialAny mode fix-its seem to always suggest inserting any. Could they be a bit smarter; like suggesting some for procedure arguments or a choice perhaps?
  • The fix-it for inserting any into optional types works very well inserting the required brackets but handling implicitly unwrapped optionals correctly seems to have been overlooked.

The link again for a rainy day:

6 Likes

It's been announced that the source incompatible parts of SE0335 will no longer be a part of Swift 6 (Phew) so the heat is off this migration problem. I've modified my script to only elide to some which realises a part of the performance motivation behind this proposal by moving to opaque types for procedure arguments and return values. It may still be worth running the script over your project or package. Source compatibility remains good. Let me know in an issue if you encounter problems.

                                                #errors                elided
#rank                          name (stars)  before  after   edits    any some Error
#---- -------------------------------------  ------  -----   -----  ----- ---- -----
#0001                    Alamofire (37713*)       0      0      50      0   50     0
#0002                     fastlane (35061*)       0      0       3      0    3     0
#0003                       Charts (25532*)       0      0      40     14   26     0
#0004                   SDWebImage (24159*)       0      0       0      0    0     0
#0005                   lottie-ios (22763*)       0      0      33      0   33     0
#0006                      RxSwift (22232*)       0      2     662    110  557   921
#0007                        vapor (21791*)       0      6     125      0  125     0
#0008                   SwiftyJSON (21366*)       0      0       1      0    1     0
#0009                         Hero (20837*)       0      0       8      0    8     0
#0010                   Kingfisher (20172*)       0      2      15      0   15     0
#0011                      SnapKit (18528*)       0      0      27      0   27     0
#0012                    SwiftLint (16168*)       3     99      34      0   34     0
#0013            IQKeyboardManager (15620*)       3      3       2      0    2     0
#0014                  realm-swift (15353*)       0      0       6      0    6     3
#0015                     carthage (14594*)       0      0       3      0    3     3
#0016                         Moya (13989*)       0      2      30      0   30    10
#0017                      perfect (13873*)       0      0       0      0    0     0
#0018                   PromiseKit (13854*)       0      0       0      0    0     0
#0019                         fmdb (13694*)       0      0       0      0    0     0
#0020              CocoaLumberjack (12703*)       0      0       0      0    0     0
#0021                    IGListKit (12409*)       3      4       1      0    1     0
#0022             CocoaAsyncSocket (12209*)       0      0       0      0    0     0
#0023                       Eureka (11443*)       3      3      13      0   13     0
#0024                 SkeletonView (11225*)       3      3       0      0    0     0
#0025                 SwifterSwift (11197*)       0      0       0      0    0     0
#0026      NVActivityIndicatorView (10141*)       0      0       0      0    0     0
#0027                         Quick (9447*)       0      0       0      0    0     0
#0028                      AudioKit (9173*)       0      0      58      0   58     0
#0029                   CryptoSwift (9100*)       0      0      16      0   16     0
#0030                  ObjectMapper (8962*)       0      0       0      0    0     0
#0031         swift-package-manager (8800*)       1      1     287      0  287     2
#0032                       R.swift (8687*)       0      0       1      0    1     0
#0033                  IBAnimatable (8620*)       3      3      30      0   30     0
#0034                  SQLite.swift (8286*)       0     40      61      0   61     0
#0035                      swiftgen (7972*)       0      9      22      0   22     0
#0036            Reachability.swift (7611*)       0      0       0      0    0     0
#0037                    PureLayout (7572*)       0      0       0      0    0     0
#0038                        Kitura (7529*)       0      6      21      0   21     0
#0039                    Starscream (7332*)       0      0      20      0   20     1
#0040                   Cartography (7295*)       0     19      37      0   37     0
#0041                       ReSwift (7206*)       0      2      11      0   11     0
#0042               JTAppleCalendar (7187*)       3      3       6      0    6     0
#0043       JVFloatLabeledTextField (7150*)       2      2       0      0    0     0
#0044              facebook-ios-sdk (7087*)       0      0      86      0   86     3
#0045                     swift-nio (7001*)       0      6     258      0  258    14
#0046                          RIBs (6939*)       3      2     248      0  248     0
#0047                     SwiftDate (6932*)       0     25      41      0   41     0
#0048                KeychainAccess (6922*)       0      0       7      6    1    75
#0049                  ViewAnimator (6745*)       3      3       0      0    0     0
#0050                          Nuke (6703*)       0      0      29      0   29     3
#0051                      sourcery (6624*)       2      9      25      0   25     0
#0052                 SwiftMessages (6545*)       3      3      14      0   14     0
#0053                   FSPagerView (6505*)       3      3       0      0    0     0
#0054 swift-composable-architecture (6300*)       0      4       0      0    0     0
#0055                    DTCoreText (6209*)       1      1       0      0    0     0
#0056                           KIF (6117*)       3      2       0      0    0     0
#0057             AMScrollingNavbar (6075*)       3      3       2      0    2     0
#0058                SwiftyStoreKit (5992*)       0      4      14      0   14     0
#0059                       Sparkle (5915*)       1      1       0      0    0     0
#0060                 SwiftEntryKit (5877*)       3      3       3      0    3     0
#0061                  swipecellkit (5851*)       3      3       4      0    4     0
#0062                         macaw (5839*)       8      8       1      0    1     0
#0063                   SwiftFormat (5763*)       0      0      23      0   23     0
#0064                  SwiftyBeaver (5506*)       0      0       4      0    4     0
#0065                      XcodeGen (5481*)       0     19       8      0    8     0
#0066                      SideMenu (5354*)       3      3       7      0    7     0
#0067                      Swinject (5298*)       0      5      19      0   19     0
#0068                    MessageKit (5191*)       3      3     222      0  222     0
#0069                    GRDB.swift (5150*)       0     12      13      1   13     2
#0070                         Surge (4997*)       0      0       0      0    0     0
#0071                 FloatingPanel (4949*)       3      3      14      0   14     0
#0072                PermissionsKit (4941*)       3      3       0      0    0     0
#0073                   OHHTTPStubs (4891*)       0      0       0      0    0     0
#0074                  Instructions (4862*)       3      3       2      0    2     0
#0075        socket.io-client-swift (4802*)       0      0       5      0    5     0
#0076                     gpuimage2 (4744*)       0      0      23      0   23     0
#0077            ESTabBarController (4742*)       3      3       0      0    0     0
#0078                      SwiftUIX (4726*)       0      2      32      0   32     0
#0079            SwiftyUserDefaults (4648*)       0      0       0      0    0     0
#0080                         async (4617*)       0      0       0      0    0     0
#0081                PhoneNumberKit (4542*)       0      0       0      0    0     0
#0082                       Advance (4462*)       0      0       0      0    0     0
#0083                        Nimble (4451*)       0      2       9      2    7     0
#0084  AnimatedCollectionViewLayout (4405*)       3      3       0      0    0     0
#0085                     chartview (4382*)       3      3       0      0    0     0
#0086              swift-algorithms (4381*)       0      0       0      0    0     0
#0087                      EFQRCode (4215*)       0      0       1      0    1     0
#0088                          bond (4212*)       0     12       0      0    0     0
#0089                        SVGKit (4188*)       9      9       0      0    0     0
#0090                         Bagel (4101*)       2      2       0      0    0     0
#0091             ActiveLabel.swift (4089*)       3      3       0      0    0     0
#0092                       Publish (4019*)       0      4       4      0    4     0
#0093                         Siren (3984*)       3      3       0      0    0     0
#0094     SkyFloatingLabelTextField (3959*)       3      3      25      0   25     0
#0095                swift-protobuf (3880*)       0      2      41      0   41     0
#0096                          Then (3840*)       0      0       0      0    0     0
#0097                       KSCrash (3827*)       3      0       0      0    0     0
#0098                  MarqueeLabel (3827*)       3      3       1      0    1     0
#0099                AlamofireImage (3818*)       0      0       8      0    8     0
#0100               TinyConstraints (3790*)      25      0      24      1   23     0
#0101                     XCGLogger (3754*)      22      0      20     15    5     0
#0102                         Valet (3751*)       0      0       0      0    0     0
#0103                    SwiftWebUI (3751*)       4      8     245    108  137     2
#0104                     DeviceKit (3693*)       3      3       0      0    0     0
#0105              firebase-ios-sdk (3653*)     116      4     524    482   44   243
#0106                      promises (3640*)      26      0      45     45    0    45
#0107                       swifter (3536*)       6      0       6      6    0     2
#0108                          Argo (3497*)       2      2       0      0    0     0
#0109                     CoreStore (3431*)     312     28    2603    441 2195    49
#0110                     periphery (3412*)      56     14      75     57   18     6
#0111                    apollo-ios (3365*)       6      4     878    766  116   146
#0112                     SwiftSoup (3363*)       7      0       5      2    3     0
#0113                        Swiftz (3319*)       3      0       0      0    0     0
#0114                     RNCryptor (3305*)       5      0       3      3    0     0
#0115              BubbleTransition (3290*)       3      3       5      3    2     0
#0116                      PanModal (3281*)       3      3      26     17    9     0
#0117                        BonMot (3269*)      37      2      46     43    3     1
#0118                        Stevia (3250*)       0      0       2      2    0     0
#0119            SwiftUI-Introspect (3193*)       0      0       0      0    0     0
#0120                   Toast-Swift (3147*)       3      3       0      0    0     0
#0121                 DifferenceKit (3130*)       5      0       3      3    0     0
#0122                 UIImageColors (3094*)       0      0       0      0    0     0
#0123              InAppSettingsKit (3094*)       1      1       0      0    0     0
#0124                 SwiftLocation (3082*)      50      0      56     48    8    12
#0125                MagazineLayout (3076*)       3      3       6      3    3     0
#0126                    OAuthSwift (3008*)      77      0      54     46   21     9
#0127                      fengniao (2958*)      10      0       4      4    0     2
#0128                        nanopb (2948*)       0      0       0      0    0     0
#0129                      AMPopTip (2915*)       3      3      62     52   10    16
#0130                 RxDataSources (2879*)     750      2       2      2    0     2
#0131             LNPopupController (2857*)       4      4       1      0    1     0
#0132                  URLNavigator (2853*)       6      0      42     20   29     1
#0133                 AloeStackView (2849*)       3      3       0      0    0     0
#0134                 ReactiveSwift (2841*)     154     25     171    133   38   102
#0135                      Reusable (2822*)       0      0       0      0    0     0
#0136                Localize-Swift (2819*)       3      3       0      0    0     0
#0137               SwiftRichString (2809*)      50      0     435     53  382     1
#0138                          Gifu (2777*)       0      0       2      1    1     0
#0139                         tuist (2756*)      25     49    1480   1069  411   103
#0140                  DynamicColor (2746*)       0      0       0      0    0     0
#0141             TwitterTextEditor (2722*)       3      3      57     33   24     4
#0142                     swift-log (2721*)      24      5      30     23    7     2
#0143               LifetimeTracker (2675*)       3      3       3      2    1     0
#0144         swift-argument-parser (2668*)     163      3     271    263    8    38
#0145                    Brightroom (2665*)       2      2      15     12    3     5
#0146                     Timepiece (2653*)       0      0       0      0    0     0
#0147        swift-snapshot-testing (2647*)      40      6      36     36    0     6
#0148                         Cache (2597*)      18      0      18     18    0    12
#0149                   WhatsNewKit (2542*)      13      0      11     10    1     0
#0150                   reel-search (2539*)       3      3       8      6    2     0
#0151                        Result (2524*)      17      0      13     13    0    14
#0152               plcrashreporter (2446*)       0      0       0      0    0     0
#0153                       Swifter (2396*)      10      0       7      7    0     4
#0154                   SwiftCharts (2396*)       3      3      96     80   19     0
#0155                        Tabman (2373*)       3      3      74     33   41     0
#0156                    ReactorKit (2367*)     761      2      13     10    3     0
#0157                     Segmentio (2365*)       3      3       0      0    0     0
#0158              HaishinKit.swift (2310*)      15     26      39     39    0    39
#0159             swift-collections (2310*)      23      0      89     89    0     1
#0160                         files (2284*)      10      0       8      8    0     8
#0161          SimulatorStatusMagic (2274*)       8      8       0      0    0     0
#0162                         Kanna (2263*)      55      2      54     38   16     0
#0163                       FileKit (2218*)      29      0      17     17    0    11
#0164                       carekit (2215*)       8      3     471    338  164    69
#0165                keychain-swift (2211*)       0      0       0      0    0     0
#0166                           Zip (2196*)       0      0       0      0    0     0
#0167                   OpenCombine (2190*)     227     22     442    305  137    67
#0168                        Render (2161*)       7      8       3      3    0     0
#0169                        siesta (2159*)       1      1     137    100   38    15
#0170                   CalendarKit (2142*)       3      3      47     27   20     0
#0171                       Stencil (2132*)       5      7     126     90   39     5
#0172               HorizonCalendar (2125*)       3      3       9      6    3     0
#0173                           Ink (2112*)       7      0       6      6    0     1
#0174   CollectionViewSlantedLayout (2101*)       3      3       0      0    0     0
#0175                      Wormholy (2070*)       1      1       8      7    1     7
#0176                        ocmock (2067*)       0      0       1      1    0     0
#0177                  SourceKitten (2063*)     195      4      63     58    5     2
#0178                       APNGKit (2033*)      17      0      15     12    3     5
#0179                          time (2013*)      35      5      33     16   17     0
#0180                     NextLevel (1991*)       3      3      28     27    1    13
#0181                     PinLayout (1979*)     119      0     121     92   29     2
#0182                         Hydra (1972*)      24      0     360     22  338    17
#0183                          Down (1957*)      29      3      34     26    8     7
#0184                        Player (1927*)       3      3       6      6    0     4
#0185                     EasyPeasy (1909*)       6      0       5      2    3     0
#0186                        APIKit (1909*)      33      0      39     35    4    22
#0187                 BrightFutures (1900*)       3     20      27     27    0    28
#0188                  XCoordinator (1869*)     742      5     121     82   42     0
#0189                          Mint (1861*)     151     19       5      5    0     2
#0190                          zewo (1860*)       4      4     135     73   62    15
#0191    CollectionViewPagingLayout (1851*)       3      3      19     17    2     0
#0192                 ZIPFoundation (1839*)       4      0       3      2    1     1
#0193                        Dwifft (1838*)       0      0       0      0    0     0
#0194                  swift-syntax (1831*)     333      5     218    188   42     2
#0195                      Watchdog (1820*)       0      0       0      0    0     0
#0196                swift-markdown (1798*)     245      8     119     84   36     1
#0197                        xcodes (1786*)      34      2      24     20    4    16
#0198                          Plot (1779*)     117     13     117     67   51     0
#0199                      Resolver (1770*)       2      0      48     46    2     0
#                                                           ====== ====== ====
#                                                            13290   6085 7325
4 Likes

Hello @johnno1962 , I truly appreciate the script you've written to expedite the existential any migration. However, I'm unsure about how to use this script in my app. I have an app with various modules that require migration. Could you please provide more detailed instructions on utilizing this script, preferably with a Git description you've written? I would be very grateful. Thank you a lot.

Hi, this script is no longer necessary as "ExistentialAny" has effectively been withdrawn from Swift 6 but if you want to increase your usage of opaque types you can still run it over your project. The easiest way to do this is clone the repo mentioned above and run the "Unbreak" target which is a small Mac .app that runs the script for you. Use the menu item File/Open Project to select your project/package's project file then press the "Prepare for Swift 6" button in the document window and see what happens. Support is pretty limited for this project now as it has been made redundant.

3 Likes

Hello @nomadcoder I've worked on something that helps me migrate 3 projects between 100k and 1M loc. Far from perfect but could definitely help.

2 Likes