2
我在swift操場內有一種奇怪的行爲。Println和String Concatention問題
當我輸入的代碼
println("test 1" + "test 2" + "test 3" + "test 4") //compiles
println("test 1" + "test 2" + "test 3" + "test 4" + "test 5") //compiles
println("test 1" + "test 2" + "test 3" + "test 4" + "test 5" + "test 6") //error!
此行的最後一行代碼不能編譯。錯誤是:
Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
我做錯了什麼,或者這是某種錯誤?看起來println()的限制是5個字符串連接?
我打得有點用Xcode的測試版6.3。看起來像蘋果公司解決了這個問題:) – nemke 2015-02-11 01:11:36
@nemke恕我直言,沙子只是轉移。它可能已經修復了一些情況,但我在6.3 beta 3中有一些表達式仍然「太複雜」。我甚至有一個表達式在Xcode 6.2中運行良好,但是我必須將其分解,因爲它顯然「太複雜了「爲6.3。 (嘆。) – Rob 2015-03-17 20:59:16