【发布时间】:2019-12-21 21:18:03
【问题描述】:
在我的项目中的 Kingfisher 库上运行 swiftlint 时出现以下错误。我正在运行 Swift 5.1.2 XCode 11.2.1
Testing failed:
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Consecutive statements on a line must be separated by ';'
Expected expression
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, SessionDelegate.SessionChallengeFunc) -> Void)?' (aka 'Optional<(_, (URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, Optional<URLCredential>) -> ())) -> ()>')
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, SessionDelegate.SessionTaskChallengeFunc) -> Void)?' (aka 'Optional<(_, (URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, Optional<URLCredential>) -> ())) -> ()>')
Cannot convert value of type '() -> ImageDownloader' to expected argument type '((_, Int) -> Bool)?'
Cannot convert value of type '() -> ()' to expected argument type '((_, (URL, Result<URLResponse, KingfisherError>)) -> Void)?'
Use of unresolved identifier 'task'
Use of unresolved identifier 'task'
Unable to infer complex closure return type; add explicit type to disambiguate
Cannot convert value of type '() -> ()' to expected argument type '((_, (Result<(Data, URLResponse?), KingfisherError>, [SessionDataTask.TaskCallback])) -> Void)?'
Expected ',' separator
Consecutive statements on a line must be separated by ';'
Consecutive statements on a line must be separated by ';'
Expected expression
Cannot convert value of type '() -> ()' to expected argument type '((_, (SessionDataTask.CancelToken, SessionDataTask.TaskCallback)) -> Void)?' (aka 'Optional<(_, (Int, SessionDataTask.TaskCallback)) -> ()>')
Command MergeSwiftModule failed with a nonzero exit code
Insufficient indentation of next 2 lines in multi-line string literal
Command CompileSwift failed with a nonzero exit code
Testing cancelled because the build failed.
我尝试了以下方法: 快速运行 swiftformat 。 swiftlint 自动更正
但没有骰子,我将它安装为 cocoapod。在我打开 Kingfisher 项目本身的问题之前,我要在这里问。
【问题讨论】:
标签: ios kingfisher