Skip to content

Commit ebfde99

Browse files
Xazax-hunj-hui
authored andcommitted
Update test/Interop/Cxx/foreign-reference/extensions.swift
Co-authored-by: John Hui <[email protected]>
1 parent 7bdd496 commit ebfde99

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed
Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
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

44
import ReferenceCounted
55

66
protocol MyProto {
7+
static func g()
78
func foo() -> Self
9+
func bar(_ x: Self)
10+
func baz()
811
}
912

10-
extension NS.LocalCount {
11-
static func g() {}
13+
extension NS.LocalCount: MyProto {
14+
static func g() {
15+
print("Static method g called")
16+
}
1217

13-
public func f() {
18+
public func foo() -> Self {
1419
Self.g()
20+
return self
21+
}
22+
23+
public func bar(_ x: Self) {
1524
}
1625
}
1726

18-
extension NS.LocalCount: MyProto {
19-
public func foo() -> Self {
20-
return self
27+
extension MyProto {
28+
func baz() {
29+
Self.g()
2130
}
2231
}
2332

33+
extension NS.LocalCount {
34+
public func f() {
35+
Self.g()
36+
}
37+
}
38+
39+
2440
let x = NS.LocalCount.create()
2541
x.f()
42+
// CHECK: Static method g called
2643
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)

0 commit comments

Comments
 (0)