![](/img/trans.png)
[英]Swift: Cannot convert value of type '() -> Bool' to expected argument type 'PFObject'
[英]error: cannot convert value of type 'ObjCBool' to expected argument type 'Bool' on Swift 4.1.2 and Kitura on Ubuntu 16.04
我有一個普通的香草Ubuntu 16.04,並在上面安裝了OpenSSH,Curl和Swift 4.1.2。 基本示例(swift軟件包init --type可執行文件)可以工作,但是當我想使用Kitura框架時,如果我“ swift build”它,則會出現編譯錯誤。
錯誤:
/.build/checkouts/Kitura.git--4845395383860597130/Sources/Kitura/staticFileServer/FileServer.swift:138:21: error: cannot convert value of type 'ObjCBool' to expected argument type 'Bool'
if !isDirectoryBool {
^~~~~~~~~~~~~~~
錯誤:終止(1):/home/thewall/swift-4.1.2-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /home/thewall/zSwift/.build/debug.yaml主要輸出:
我的package.swift文件如下所示:
導入PackageDescription
let package = Package(名稱:“ zSwift”,依賴項:[.package(url:“ https://github.com/IBM-Swift/Kitura.git ”,> .upToNextMinor(from:“ 2.1.0”)) ,],目標:[.target(名稱:“ zSwift”,依賴項:[“ Kitura”]),])
uname -a給出:
Linux thewall 4.10.0-28-通用#32〜16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU / Linux
有任何想法嗎?
Kitura正確處理了它,請參閱https://github.com/IBM-Swift/Kitura/blob/master/Sources/Kitura/staticFileServer/FileServer.swift#L95
但是,您使用的Kitura版本已過時,而Swift版本尚未更新。 請更新Kitura到最新版本2.4.1。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.