Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.x support #1

Open
dsperling opened this issue Feb 12, 2018 · 0 comments
Open

Swift 4.x support #1

dsperling opened this issue Feb 12, 2018 · 0 comments

Comments

@dsperling
Copy link

dsperling commented Feb 12, 2018

I was attempting to compile this with Swift 4.0.3 and got a strange compiler error. No code changes were identified by the Swift conversion tool. Here is the updated Package.swift for 4.x:

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "AlexaSkillsKit",
    targets: [
        .target(name: "AlexaSkillsKit", exclude: ["Samples"]),
        .testTarget(name: "AlexaSkillsKitTests", dependencies: ["AlexaSkillsKit"])
    ]
)

The compile error is the following after setting .swift-version to 4.0.3:

./build-linux.sh 
Compile Swift Module 'AlexaSkillsKit' (8 sources)
Compile Swift Module 'AlexaSkillsKitTests' (6 sources)
/app/Tests/AlexaSkillsKitTests/RequestDispatcherTests.swift:12:80: error: extra argument 'sessionAttributes' in call
        next(.success(standardResponse: StandardResponse(), sessionAttributes: [String: Any]()))
                                                                               ^~~~~~~~~~~~~~~
/app/Tests/AlexaSkillsKitTests/RequestDispatcherTests.swift:17:80: error: extra argument 'sessionAttributes' in call
        next(.success(standardResponse: StandardResponse(), sessionAttributes: [String: Any]()))
                                                                               ^~~~~~~~~~~~~~~
/app/Tests/AlexaSkillsKitTests/RequestDispatcherTests.swift:22:23: error: missing argument for parameter #1 in call
        next(.success())
                      ^
                      <#T#>
AlexaSkillsKit.Result:2:10: note: 'success' declared here
    case success(T)
         ^
/app/Tests/AlexaSkillsKitTests/RequestHandlerTests.swift:7:80: error: extra argument 'sessionAttributes' in call
        next(.success(standardResponse: StandardResponse(), sessionAttributes: [:]))
                                                                               ^~~
/app/Tests/AlexaSkillsKitTests/RequestHandlerTests.swift:11:80: error: extra argument 'sessionAttributes' in call
        next(.success(standardResponse: StandardResponse(), sessionAttributes: [:]))
                                                                               ^~~
/app/Tests/AlexaSkillsKitTests/RequestHandlerTests.swift:15:23: error: missing argument for parameter #1 in call
        next(.success())
                      ^
                      <#T#>
AlexaSkillsKit.Result:2:10: note: 'success' declared here
    case success(T)
         ^

I have seen similar errors in Swift 2->3 ports, but it was always a type mis-match in the code. The code looks correct in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant