File tree 1 file changed +31
-7
lines changed
test/Interop/Cxx/foreign-reference
1 file changed +31
-7
lines changed Original file line number Diff line number Diff line change 1
- // RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental- cxx-interop -Xfrontend -disable-availability-checking -Onone)
1
+ // RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -cxx-interoperability-mode=default -Xfrontend -disable-availability-checking -Onone) | %FileCheck %s
2
2
// REQUIRES: executable_test
3
3
4
+ // Metadata for foreign reference types is not supported on Windows.
5
+ // UNSUPPORTED: OS=windows-msvc
6
+
4
7
import ReferenceCounted
5
8
6
9
protocol MyProto {
10
+ static func g( )
7
11
func foo( ) -> Self
12
+ func bar( _ x: Self )
13
+ func baz( )
8
14
}
9
15
10
- extension NS . LocalCount {
11
- static func g( ) { }
16
+ extension NS . LocalCount : MyProto {
17
+ static func g( ) {
18
+ print ( " Static method g called " )
19
+ }
12
20
13
- public func f ( ) {
21
+ public func foo ( ) -> Self {
14
22
Self . g ( )
23
+ return self
24
+ }
25
+
26
+ public func bar( _ x: Self ) {
15
27
}
16
28
}
17
29
18
- extension NS . LocalCount : MyProto {
19
- public func foo( ) -> Self {
20
- return self
30
+ extension MyProto {
31
+ func baz( ) {
32
+ Self . g ( )
33
+ }
34
+ }
35
+
36
+ extension NS . LocalCount {
37
+ public func f( ) {
38
+ Self . g ( )
21
39
}
22
40
}
23
41
42
+
24
43
let x = NS . LocalCount. create ( )
25
44
x. f ( )
45
+ // CHECK: Static method g called
26
46
let _ = x. foo ( )
47
+ // CHECK-NEXT: Static method g called
48
+ let _ = x. baz ( )
49
+ // CHECK-NEXT: Static method g called
50
+ x. bar ( x)
You can’t perform that action at this time.
0 commit comments