From ceb4ea965d611a5407af14a4d8a5c9b6e010c5e1 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Mon, 6 Nov 2023 11:18:49 +0000 Subject: [PATCH] Fix spelling of retroactive guard Motivation: `hasFeature(RetroactiveAttribute)` doesn't work as expected, but `$RetroactiveAttribute` does. Modifications: Switch from `hasFeature` to `$RetroactiveAttribute`. Result: - `@retroactive` is applied appropriately --- 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 d6051cb8..b75008a0 100644 --- a/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift +++ b/Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Foundation -#if hasFeature(RetroactiveAttribute) +#if $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 eccfd746..280d740d 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 hasFeature(RetroactiveAttribute) +#if $RetroactiveAttribute extension URL: @retroactive ExpressibleByArgument {} extension GeneratorMode: @retroactive ExpressibleByArgument {} extension FeatureFlag: @retroactive ExpressibleByArgument {}