From 0805fec9c0963b779de1722e793fe862d4432d6a Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 1 Nov 2023 10:22:31 +0000 Subject: [PATCH] Use granular RetroactiveAttribute feature guard To protect against corner-cases where the more coarse compiler guard is insufficient. --- Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift | 2 +- Sources/swift-openapi-generator/Extensions.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift b/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift index 2d6dc601..d6051cb8 100644 --- a/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift +++ b/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Foundation -#if compiler(>=5.11) +#if hasFeature(RetroactiveAttribute) extension FileHandle: @retroactive TextOutputStream {} #else extension FileHandle: TextOutputStream {} diff --git a/Sources/swift-openapi-generator/Extensions.swift b/Sources/swift-openapi-generator/Extensions.swift index e847da49..eccfd746 100644 --- a/Sources/swift-openapi-generator/Extensions.swift +++ b/Sources/swift-openapi-generator/Extensions.swift @@ -16,7 +16,7 @@ import ArgumentParser import _OpenAPIGeneratorCore import Yams -#if compiler(>=5.11) +#if hasFeature(RetroactiveAttribute) extension URL: @retroactive ExpressibleByArgument {} extension GeneratorMode: @retroactive ExpressibleByArgument {} extension FeatureFlag: @retroactive ExpressibleByArgument {}