Using a VFS overlay prevents strict concurrency checking from diagnosing valid violations in Swift 5.10.
Reproduction
# prepare the dependency
swiftc \
-c ModuleMinimal/ExampleMinimal.swift \
-strict-concurrency=minimal \
-emit-module \
-emit-module-path build/ModuleMinimal.swiftmodule \
-module-name ModuleMinimal \
-whole-module-optimization \
-parse-as-library \
-o build/ModuleMinimal.o
# use the dependency without VFS
#
# correctly outputs:
# warning: static property 'one' is not concurrency-safe because it is not either conforming to 'Sendable'
# or isolated to a global actor; this is an error in Swift 6
swiftc \
-c ModuleComplete/ExampleComplete.swift \
-strict-concurrency=complete \
-emit-module \
-emit-module-path build/ModuleComplete.swiftmodule \
-module-name ModuleComplete \
-whole-module-optimization \
-parse-as-library \
-I build \
-o build/ModuleComplete.o \
# use the dependency with VFS
#
# incorrectly shows no output
swiftc \
-c ModuleComplete/ExampleComplete.swift \
-strict-concurrency=complete \
-emit-module \
-emit-module-path build/ModuleComplete.swiftmodule \
-module-name ModuleComplete \
-whole-module-optimization \
-parse-as-library \
-Xfrontend -vfsoverlay \
-Xfrontend vfs-overlay.yaml \
-I/vfs_swiftmodules \
-o build/ModuleComplete.o
# ExampleMinimal.swift
import Foundation
public struct ExampleMinimal {
public let number: Int
public static let one = ExampleMinimal(number: 1) // a declaration that does not pass `strict-concurrency=complete`
}
# ExampleComplete.swift
import Foundation
import ModuleMinimal
public struct ExampleComplete {
public let number: Int
public init() {
number = ExampleMinimal.one.number // expected to raise an issue here
}
}
Compliations with and without VFS should show warning: static property 'one' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6.
Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Description
Using a VFS overlay prevents strict concurrency checking from diagnosing valid violations in Swift 5.10.
Reproduction
Expected behavior
Compliations with and without VFS should show
warning: static property 'one' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
.Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Additional information
No response