Skip to content

Commit 46eb9ee

Browse files
committed
Fix issue with SPI protocol requirement
1 parent 8adfdb1 commit 46eb9ee

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,21 @@ extension GenericArgumentSyntax {
405405
}
406406
}
407407

408+
extension FreestandingMacroExpansionSyntax {
409+
// SPI protocol requirements require a default implementation, but this should never be used because there should be
410+
// no conforming types outside of SwiftSyntax.
411+
@_spi(ExperimentalLanguageFeatures)
412+
@available(*, deprecated, message: "concrete type should implement its own moduleSelector property")
413+
public var moduleSelector: ModuleSelectorSyntax? {
414+
get {
415+
return nil
416+
}
417+
set {
418+
fatalError("\(Self.self) should implement its own moduleSelector property")
419+
}
420+
}
421+
}
422+
408423
extension FunctionCallExprSyntax {
409424
@_disfavoredOverload
410425
@available(

0 commit comments

Comments
 (0)