File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- // RUN: %target-swift-frontend -emit-ir %s -parse-stdlib -enable-experimental-feature Embedded
1
+ // This test is checking that usage of an existential (which is normally
2
+ // disallowed in embedded Swift and flagged in IRGen) is left undiagnosed
3
+ // because the context is @_unavailableInEmbedded.
4
+ //
5
+ // The breakdown of that is
6
+ // - (1) @_unavailableInEmbedded makes the declaration unavailable,
7
+ // - (2) unavailable function bodies is removed in embedded Swift,
8
+ // - (3) the test() function is not reported by the existential checker.
9
+
10
+ // RUN: %target-swift-frontend -emit-ir %s -parse-stdlib | %FileCheck %s --check-prefix CHECK-A
11
+ // RUN: %target-swift-frontend -emit-ir %s -parse-stdlib -enable-experimental-feature Embedded | %FileCheck %s --check-prefix CHECK-B
2
12
3
13
public protocol Player { }
4
14
struct Concrete : Player { }
@@ -7,3 +17,6 @@ struct Concrete: Player {}
7
17
public func test( ) -> any Player {
8
18
Concrete ( ) // no error because we're in unavailable-in-embedded context
9
19
}
20
+
21
+ // CHECK-A: $s4main4testAA6Player_pyF
22
+ // CHECK-B-NOT: $s4main4testAA6Player_pyF
You can’t perform that action at this time.
0 commit comments