File tree Expand file tree Collapse file tree 1 file changed +28
-7
lines changed
test/Interop/Cxx/foreign-reference Expand file tree Collapse file tree 1 file changed +28
-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
4
import ReferenceCounted
5
5
6
6
protocol MyProto {
7
+ static func g( )
7
8
func foo( ) -> Self
9
+ func bar( _ x: Self )
10
+ func baz( )
8
11
}
9
12
10
- extension NS . LocalCount {
11
- static func g( ) { }
13
+ extension NS . LocalCount : MyProto {
14
+ static func g( ) {
15
+ print ( " Static method g called " )
16
+ }
12
17
13
- public func f ( ) {
18
+ public func foo ( ) -> Self {
14
19
Self . g ( )
20
+ return self
21
+ }
22
+
23
+ public func bar( _ x: Self ) {
15
24
}
16
25
}
17
26
18
- extension NS . LocalCount : MyProto {
19
- public func foo ( ) -> Self {
20
- return self
27
+ extension MyProto {
28
+ func baz ( ) {
29
+ Self . g ( )
21
30
}
22
31
}
23
32
33
+ extension NS . LocalCount {
34
+ public func f( ) {
35
+ Self . g ( )
36
+ }
37
+ }
38
+
39
+
24
40
let x = NS . LocalCount. create ( )
25
41
x. f ( )
42
+ // CHECK: Static method g called
26
43
let _ = x. foo ( )
44
+ // CHECK-NEXT: Static method g called
45
+ let _ = x. baz ( )
46
+ // CHECK-NEXT: Static method g called
47
+ x. bar ( x)
You can’t perform that action at this time.
0 commit comments