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 6 build fails #81

Open
multitudes opened this issue Jun 22, 2024 · 7 comments
Open

Swift 6 build fails #81

multitudes opened this issue Jun 22, 2024 · 7 comments

Comments

@multitudes
Copy link

I thought this is interesting. It doesn't find the URL extension when compiling with the Swift 6 keychain.
The output is:

Building for debugging...
[0/5] Write sources
[1/5] Write swift-version-6A63A117629E05AE.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[3/7] Emitting module IgniteStarter
/Users/laurentb/Developer/Ignite/ExampleSite/Sources/Site.swift:20:15: error: ambiguous use of 'init(_:)'
18 |     var name = "Hello World"
19 |     var titleSuffix = "My Awesome Site"
20 |     var url = URL("https://www.example.com")
   |               `- error: ambiguous use of 'init(_:)'
21 |     var builtInIconsEnabled = true

Swift 5.10 has no problem with it!

@markstamer
Copy link
Collaborator

markstamer commented Jun 24, 2024

The ambiguity can be resolved by stating a the non optional URL type like this.

var url: URL = URL("https://www.example.com")

But maybe the better approach is to adapt the custom URL extension in URL-Unwrapped.swift and use a parameter name?

var url: URL = URL(static: "https://www.example.com")

@twostraws
Copy link
Owner

It's not ideal, but we could change this. I'm really curious what's causing the breakage here!

@clarkezone
Copy link

I'm hitting this issue also

@Rspoon3
Copy link

Rspoon3 commented Aug 22, 2024

Still an issue with Version 16.0 beta 6 (16A5230g).

@ppporch
Copy link

ppporch commented Aug 26, 2024

Xcode Version 16.0 beta 6 (16A5230g) has an issue with var url: URL = URL(static: "https://www.example.com"). I get an error message of extraneous argument label 'static:' in call. To fix, remove static:

URL = URL("https://www.example.com") works

@0xTim
Copy link
Contributor

0xTim commented Sep 19, 2024

This should work now in Swift 6, tested with swift:6.0

@appfrosch
Copy link
Contributor

This should work now in Swift 6, tested with swift:6.0

You mean without having to change anything? If so, how–cause I just started looking into Ignite yesterday and had this error as well without any code changes after creating a new site with ignite new MeWebsite, using the latest Xcode Version 16.0 (16A242d) …

I also tried to change the Package to this without success:

// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "IgniteStarter",
    platforms: [.macOS(.v13)],
    dependencies: [
        .package(url: "https://github.com/twostraws/Ignite.git", branch: "main")
    ],
    targets: [
        .executableTarget(
            name: "IgniteStarter",
            dependencies: ["Ignite"]),
    ],
    swiftLanguageModes: [.v6]
)

I got around this by changing the line to var url: URL = URL("https://www.example.com") (as stated in this issue thread).

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

8 participants