簡體   English   中英

錯誤:無法將類型'ObjCBool​​'的值轉換為Swift 4.1.2上的預期參數類型'Bool'以及Ubuntu 16.04上的Kitura

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM