An open source Universal Plug and Play library with a focus on media streaming coordination using the UPnP A/V profile; written in Swift but for both Objective-C and Swift apps.
MIT License
137
stars
55
forks
source link
Swift 1.2: Enums with more than one associated value can't hold a generic value. #12
Because enum Result could contain a generic value or an NSError, the original compiler error was: unimplemented IR generation feature non-fixed multi-payload enum layout.
The original workaround was to use an autoclosure to enclose the generic value in a block that returned the value. As of Swift 1.2, the @autoclosure attribute is now an attribute on a parameter, not an attribute on the parameter’s type, and can only be used in functions, not init or for an enum's associated value.
New workaround is to use a boxing object to wrap the generic value in.
Discussions:
Because
enum Result
could contain a generic value or an NSError, the original compiler error was: unimplemented IR generation feature non-fixed multi-payload enum layout.The original workaround was to use an autoclosure to enclose the generic value in a block that returned the value. As of Swift 1.2, the @autoclosure attribute is now an attribute on a parameter, not an attribute on the parameter’s type, and can only be used in functions, not init or for an enum's associated value.
New workaround is to use a boxing object to wrap the generic value in. Discussions: