Skip to content

Commit 37c5870

Browse files
committed
[Macros] Add a plugin capability for infer-nonisolated-conformances
The compiler will need to be able to distinguish between macro implementations that know about infer-nonisolated-conformances (such that the plugin itself can apply the transform) vs. those that predate this transform (in which case the compiler will need to do it).
1 parent 791127b commit 37c5870

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/SwiftCompilerPluginMessageHandling/CompilerPluginMessageHandler.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ import SwiftSyntaxMacros
3030
@_spi(PluginMessage)
3131
public enum PluginFeature: String {
3232
case loadPluginLibrary = "load-plugin-library"
33+
34+
/// Whether the plugin knows how to infer nonisolated conformances.
35+
case inferNonisolatedConformances = "infer-nonisolated-conformances"
3336
}
3437

3538
/// A type that provides the actual plugin functions.

Sources/SwiftLibraryPluginProvider/LibraryPluginProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class LibraryPluginProvider: PluginProvider {
8484
public static let shared: LibraryPluginProvider = LibraryPluginProvider()
8585

8686
public var features: [PluginFeature] {
87-
[.loadPluginLibrary]
87+
[.loadPluginLibrary, .inferNonisolatedConformances]
8888
}
8989

9090
public func loadPluginLibrary(libraryPath: String, moduleName: String) throws {

0 commit comments

Comments
 (0)