File tree Expand file tree Collapse file tree 1 file changed +31
-7
lines changed
test/Interop/Cxx/foreign-reference Expand file tree Collapse file tree 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
22// REQUIRES: executable_test
33
4+ // Metadata for foreign reference types is not supported on Windows.
5+ // UNSUPPORTED: OS=windows-msvc
6+
47import ReferenceCounted
58
69protocol MyProto {
10+ static func g( )
711 func foo( ) -> Self
12+ func bar( _ x: Self )
13+ func baz( )
814}
915
10- extension NS . LocalCount {
11- static func g( ) { }
16+ extension NS . LocalCount : MyProto {
17+ static func g( ) {
18+ print ( " Static method g called " )
19+ }
1220
13- public func f ( ) {
21+ public func foo ( ) -> Self {
1422 Self . g ( )
23+ return self
24+ }
25+
26+ public func bar( _ x: Self ) {
1527 }
1628}
1729
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 ( )
2139 }
2240}
2341
42+
2443let x = NS . LocalCount. create ( )
2544x. f ( )
45+ // CHECK: Static method g called
2646let _ = 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