Skip to content

Build error on Xcode 7.3 beta 2 (Swift 2.2) #425

@norio-nomura

Description

@norio-nomura

log:

SwiftLint/Source/SwiftLintFrameworkTests/IntegrationTests.swift:29:54: error: cannot convert value of type 'String' to expected argument type 'StaticString'
XCTFail($0.reason, file: $0.location.file!, line: UInt($0.location.line!))

That is expanding linting result into XCTFail() that introduced on #404:

class IntegrationTests: XCTestCase {
    func testSwiftLintLints() {
        // This is as close as we're ever going to get to a self-hosting linter.
        let directory = (((__FILE__ as NSString)
            .stringByDeletingLastPathComponent as NSString)
            .stringByDeletingLastPathComponent as NSString)
            .stringByDeletingLastPathComponent
        NSFileManager.defaultManager().changeCurrentDirectoryPath(directory)
        let config = Configuration(path: Configuration.fileName)
        let swiftFiles = config.lintableFilesForPath("")
        XCTAssert(swiftFiles.map({$0.path!}).contains(__FILE__), "current file should be included")
        let violations = swiftFiles.flatMap {
            Linter(file: $0, configuration: config).styleViolations
        }
        violations.forEach {
            XCTFail($0.reason, file: $0.location.file!, line: UInt($0.location.line!))
        }
    }
}

Related:
https://bugs.swift.org/browse/SR-308?jql=text%20~%20%22staticstring%22
swiftlang/swift#888
swiftlang/swift-corelibs-xctest#27

😢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions