File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1678,7 +1678,7 @@ namespace {
1678
1678
// \endcode
1679
1679
//
1680
1680
// Here `P.foo` would be replaced with `S.foo`
1681
- if (!isExistentialMetatype && baseTy->is <ProtocolType> () &&
1681
+ if (!isExistentialMetatype && baseTy->isConstraintType () &&
1682
1682
member->isStatic ()) {
1683
1683
auto selfParam =
1684
1684
overload.adjustedOpenedFullType ->castTo <FunctionType>()->getParams ()[0 ];
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-silgen %s
2
+
3
+ // rdar://150858005
4
+ protocol P { }
5
+ protocol Q { }
6
+
7
+ struct MyP : P , Q { }
8
+
9
+ extension P where Self == MyP {
10
+ static var myP : Self { return MyP ( ) }
11
+ }
12
+
13
+ func test( ) {
14
+ let _: any P & Q = . myP
15
+ }
16
+
17
+ // rdar://148708774
18
+ protocol Wrapper < Wrapped> {
19
+ associatedtype Wrapped
20
+ }
21
+ struct IntWrapper : Wrapper {
22
+ typealias Wrapped = Int
23
+ }
24
+
25
+ extension Wrapper where Self == IntWrapper {
26
+ static var int : Self { fatalError ( ) }
27
+ }
28
+
29
+ let crashes : any Wrapper < Int > = . int
30
+ let ok1 : some Wrapper < Int > = . int
31
+ let ok2 : any Wrapper = . int
You can’t perform that action at this time.
0 commit comments