File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t/src)
2+ // RUN: split-file %s %t/src
3+
4+ /// Build the library A
5+ // RUN: %target-swift-frontend -emit-module %t/src/API.swift \
6+ // RUN: -module-name API -swift-version 5 \
7+ // RUN: -emit-module-path %t/API.swiftmodule
8+
9+ // Build client with module
10+ // RUN: %target-swift-emit-silgen \
11+ // RUN: -I %t \
12+ // RUN: -module-name Client \
13+ // RUN: %t/src/Client.swift -verify
14+
15+ //--- API.swift
16+
17+ public class C { }
18+
19+ public protocol P1 {
20+ typealias A = ( C & P1 )
21+ }
22+
23+ public protocol P2 {
24+ typealias F = ( P2 ) -> Void
25+ }
26+
27+ public protocol P3 where Self : C {
28+ }
29+
30+ //--- Client.swift
31+ import API
32+
33+ func test( _: any P1 ) { } // Ok
34+
35+ _ = P2 . self // Ok
36+
37+ class B : P3 {
38+ // expected-error@-1 {{type 'B' does not conform to protocol 'P3'}}
39+ // expected-error@-2 {{'P3' requires that 'B' inherit from 'C'}}
40+ // expected-note@-3 {{requirement specified as 'Self' : 'C' [with Self = B]}}
41+ }
You can’t perform that action at this time.
0 commit comments