GM release of Xcode 6 compile

前端 未结 21 2434
难免孤独
难免孤独 2020-12-02 15:37

I just downloaded the GM release of Xcode 6 and it won\'t compile with this error:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault         


        
21条回答
  •  执念已碎
    2020-12-02 16:35

    By following @maxvel's suggestion, I got to know that max() and min() functions failed to compile in the release mode. I replaced it with my own functions like below.

    //Swift compiler seems to failing to compile default min and max functions in release 
    //mode hence writing my own
    //
    func maximum (one: T, other: T) -> T {
        if one > other {
            return one
        }
        else {
            return other
        }
    }
    
    func minimum (one: T, other: T) -> T {
        if one < other {
            return one
        }
        else {
            return other
        }
    }
    

提交回复
热议问题