nicklockwood / layout

A declarative UI framework for iOS
MIT License
2.23k stars 97 forks source link

Swift 5.1 - Compile error #174

Closed Kaspik closed 5 years ago

Kaspik commented 5 years ago

Hey Nick again!

I know it's super early but opening this issue so you can take a look on it as well if interested and maybe also create branch master_xcode11 that would be buildable on new XCode with Swift 5.1.

Currently the library is not working there as:

extension ArraySlice: _SwiftArray {
    fileprivate var values: [Any] {
        return Array(self)
    }

    static func cast(_ value: Any) -> Any? {
        return (AnyExpression.arrayCast(value) as [Element]?).map(self.init)
    }
}

on line

        return (AnyExpression.arrayCast(value) as [Element]?).map(self.init)

throws error: Partial application of 'mutating' method is not allowed.

Thank you! :)

Kaspik commented 5 years ago

Thank you @nicklockwood for quick response and merging! Looking forward to see it on CocoaPods soon and be able to build project again 🚀