Skip to content

Commit 893b3db

Browse files
authored
Use granular RetroactiveAttribute feature guard (#359)
### Motivation To protect against corner-cases where the more coarse compiler guard is insufficient. ### Modifications Use granular `RetroactiveAttribute` feature guard ### Result Safer code building. ### Test Plan Tested code building with 5.8 on Linux
1 parent 2081703 commit 893b3db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414
import Foundation
1515

16-
#if compiler(>=5.11)
16+
#if hasFeature(RetroactiveAttribute)
1717
extension FileHandle: @retroactive TextOutputStream {}
1818
#else
1919
extension FileHandle: TextOutputStream {}

Sources/swift-openapi-generator/Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import ArgumentParser
1616
import _OpenAPIGeneratorCore
1717
import Yams
1818

19-
#if compiler(>=5.11)
19+
#if hasFeature(RetroactiveAttribute)
2020
extension URL: @retroactive ExpressibleByArgument {}
2121
extension GeneratorMode: @retroactive ExpressibleByArgument {}
2222
extension FeatureFlag: @retroactive ExpressibleByArgument {}

0 commit comments

Comments
 (0)