Skip to content

Commit 8741ad4

Browse files
committed
[Test] Add availability checks to implementation-only-opaque-type
1 parent 71f116c commit 8741ad4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/Serialization/Recovery/implementation-only-opaque-type.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public struct HiddenType : Proto {
3030
import BaseLib
3131
@_implementationOnly import HiddenLib
3232

33+
@available(SwiftStdlib 5.1, *) // for the `some` keyword.
3334
public struct PublicStruct {
3435
public init() {}
3536
public func foo() -> some Proto {
@@ -41,5 +42,7 @@ public struct PublicStruct {
4142

4243
import Lib
4344

44-
var s = PublicStruct()
45-
let r = s.foo()
45+
if #available(SwiftStdlib 5.1, *) {
46+
let s = PublicStruct()
47+
let r = s.foo()
48+
}

0 commit comments

Comments
 (0)