File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-build-swift %s -o %t/a.out
3
+ // RUN: %target-run %t/a.out | %FileCheck %s
4
+ // REQUIRES: executable_test
5
+
6
+ // REQUIRES: objc_interop
7
+ import Foundation
8
+ class K { }
9
+ enum MixedBridged {
10
+ case Native( K )
11
+ case Bridged( [ K ] )
12
+ case Empty
13
+ }
14
+
15
+ struct Container {
16
+ var storage : MixedBridged = . Empty
17
+
18
+ mutating func adoptStyle( _ s: [ K ] ) {
19
+ storage = . Bridged( s)
20
+ }
21
+ }
22
+
23
+ func copyStorage( _ s: [ K ] , _ x : Container ) -> Container {
24
+ var c = x
25
+ c. adoptStyle ( s)
26
+ return c
27
+ }
28
+
29
+ func testCase( ) {
30
+ let nsArray = NSArray ( objects: K ( ) , K ( ) ) as! [ K ]
31
+ let l = Container ( )
32
+ let c = copyStorage ( nsArray, l)
33
+ print ( c)
34
+ }
35
+
36
+ // CHECK: Container(storage: a.MixedBridged.Bridged([a.K, a.K]))
37
+ testCase ( )
You can’t perform that action at this time.
0 commit comments