I'm trying to implement newly added access specifier package
public class PackageDemoLibrary {
public init() {}
public var publicVariable = ""
package var packageVariable = ""
}
but it's saying Decl has a package access level but no -package-name was passed.
As per documentation: A new flag -package-name is passed down to a commandline invocation, as follows. Read more here
swiftc -module-name Engine -package-name gamePkg ...
swiftc -module-name Game -package-name gamePkg ...
swiftc -module-name App -package-name appPkg ...
I'm not sure how can I add -package name in to my SPM Package.
Anyone know how can I get rid of this error
Go to your Package.swift file and check the version of your swift-tools-version
. It should be on the first line.
Since the package
modifier was introduced in Swift 5.9, check if you're using swift-tools-version
in a version greater than 5.9
.