File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ makeSubstUsableFromInline(const SubstitutionMap &substs) {
191
191
for (Type replType : substs.getReplacementTypes ()) {
192
192
makeTypeUsableFromInline (replType->getCanonicalType ());
193
193
}
194
+ for (ProtocolConformanceRef pref : substs.getConformances ()) {
195
+ if (pref.isConcrete ()) {
196
+ ProtocolConformance *concrete = pref.getConcrete ();
197
+ makeDeclUsableFromInline (concrete->getProtocol (), M);
198
+ }
199
+ }
194
200
}
195
201
196
202
// / Decide whether to serialize a function.
Original file line number Diff line number Diff line change @@ -152,6 +152,29 @@ public func callFoo_gen<T>(_ t: T) {
152
152
printFooGeneric ( 1234 )
153
153
}
154
154
155
+ fileprivate protocol PrivateProto {
156
+ func foo( )
157
+ }
158
+
159
+ public class FooClass : PrivateProto {
160
+ func foo( ) {
161
+ print ( 321 )
162
+ }
163
+ }
164
+
165
+ @inline ( never)
166
+ @_semantics ( " optimize.sil.specialize.generic.never " )
167
+ fileprivate func callProtocolFoo< T: PrivateProto > ( _ t: T ) {
168
+ t. foo ( )
169
+ }
170
+
171
+ @inline ( never)
172
+ @_semantics ( " optimize.sil.specialize.generic.never " )
173
+ public func callFooViaConformance< T> ( _ t: T ) {
174
+ let c = FooClass ( )
175
+ callProtocolFoo ( c)
176
+ }
177
+
155
178
@inline ( never)
156
179
public func callGenericSubmoduleFunc< T> ( _ t: T ) {
157
180
genericSubmoduleFunc ( t)
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ func testProtocolsAndClasses() {
83
83
callFoo_gen ( 27 )
84
84
// CHECK-OUTPUT: 55
85
85
callClassMethod ( 55 )
86
+ // CHECK-OUTPUT: 321
87
+ callFooViaConformance ( 0 )
86
88
}
87
89
88
90
func testSubModule( ) {
You can’t perform that action at this time.
0 commit comments