Skip to main content

Dynamic generic types

Abstract Prior to the Swift 5.7 release, there was a lack of support for using protocols with associatedtype as a type of passed argument or as a returning type. Prior to this release, the options to solve such tasks as with SE-0309 and SE-0346 were not available. However, these tasks still exist. In the past, Apple’s solution was to do a lot of boilerplate code, such as writing many overloaded methods to cover all cases.