You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that I am receiving a false positive for type_contents_order when using a custom availability macro in a Swift Package. When I don't use the custom availability macro and just use Apple's built in ones, SwiftLint does not throw a false positive at all.
Here is my Package.swift file defining the availability macro -
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
letpackage=Package(
name:"SwiftLintRegression",
platforms:[.iOS(.v15)],
products:[.library(
name:"SwiftLintRegression",
targets:["SwiftLintRegression"]),],
dependencies:[.package(url:"https://github.com/SimplyDanny/SwiftLintPlugins", exact:"0.58.2")],
targets:[.target(
name:"SwiftLintRegression",
swiftSettings:[.enableExperimentalFeature("AvailabilityMacro=SwiftUI_v5:iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, visionOS 1.0" // https://github.com/swiftlang/swift/pull/65218
)],
plugins:[.plugin(name:"SwiftLintBuildToolPlugin",package:"SwiftLintPlugins")]),])
And here is my sample view which throws the error -
import SwiftUI
structContentView:View{
// type_contents_order violation thrown here
@available(SwiftUI_v5,*)varv5Body:someView{EmptyView()}varbody:someView{EmptyView()}}
Swapping around the vars does not solve the issue.
If I replace it with the following, the error isn't thrown.
New Issue Checklist
Bug Description
I have noticed that I am receiving a false positive for
type_contents_order
when using a custom availability macro in a Swift Package. When I don't use the custom availability macro and just use Apple's built in ones, SwiftLint does not throw a false positive at all.Here is my Package.swift file defining the availability macro -
And here is my sample view which throws the error -
Swapping around the vars does not solve the issue.
If I replace it with the following, the error isn't thrown.
Environment
Are you using nested configurations? If so, paste their
relative paths and respective contents.
N/A
The text was updated successfully, but these errors were encountered: