Skip to content

Commit 7f75ac1

Browse files
Add a test case for SR-11227 (extending a protocol composition).
1 parent c85eae1 commit 7f75ac1

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
struct S {}
2+
3+
extension S : P2 {}
4+
5+
extension S : P1_1 {}
6+
7+
func f() {
8+
let s = S.init()
9+
s.p1_1()
10+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// XFAIL: *
2+
// RUN: %empty-directory(%t)
3+
// RUN: %target-swift-frontend -primary-file %s %S/Inputs/composition_extensions_usage.swift -emit-module-path %t/P-partial.swiftmodule -module-name SR11227 -enable-testing
4+
// RUN: %target-swift-frontend -primary-file %S/Inputs/composition_extensions_usage.swift %s -emit-module-path %t/S-partial.swiftmodule -module-name SR11227 -enable-testing
5+
// RUN: %target-swift-frontend -sil-merge-partial-modules %t/P-partial.swiftmodule %t/S-partial.swiftmodule -emit-module -o %t/SR11227.swiftmodule
6+
7+
protocol P0 {}
8+
9+
protocol P1 {}
10+
11+
protocol P1_1 : P1 {
12+
func p1_1()
13+
}
14+
15+
protocol P2 {}
16+
17+
extension P1 & P1_1 where Self : P2 {
18+
func p1_1() {}
19+
}

0 commit comments

Comments
 (0)