Skip to content

Commit

Permalink
Use granular RetroactiveAttribute feature guard (#359)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
rnro authored Nov 1, 2023
1 parent 2081703 commit 893b3db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Foundation

#if compiler(>=5.11)
#if hasFeature(RetroactiveAttribute)
extension FileHandle: @retroactive TextOutputStream {}
#else
extension FileHandle: TextOutputStream {}
Expand Down
2 changes: 1 addition & 1 deletion Sources/swift-openapi-generator/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 893b3db

Please sign in to comment.