File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -2469,7 +2469,10 @@ bool ConstraintSystem::isPartialApplication(ConstraintLocator *locator) {
2469
2469
2470
2470
auto baseTy =
2471
2471
simplifyType (getType (UDE->getBase ()))->getWithoutSpecifierType ();
2472
- return getApplicationLevel (*this , baseTy, UDE) < 2 ;
2472
+ auto level = getApplicationLevel (*this , baseTy, UDE);
2473
+ // Static members have base applied implicitly which means that their
2474
+ // application level is lower.
2475
+ return level < (baseTy->is <MetatypeType>() ? 1 : 2 );
2473
2476
}
2474
2477
2475
2478
DeclReferenceType
Original file line number Diff line number Diff line change @@ -206,3 +206,25 @@ func generic3<T>(_ x: T) async {
206
206
207
207
await generic3 ( GenericS< NonSendable> . f)
208
208
}
209
+
210
+ // Make sure that static members are handled properly
211
+ do {
212
+ struct X < T> {
213
+ init ( _: T ) {
214
+ }
215
+
216
+ static func test( _: T ) { }
217
+ }
218
+
219
+ class Test < T> {
220
+ init ( _: T ) {
221
+ _ = X ( self ) // Ok
222
+ _ = X . init ( self ) // Ok
223
+ _ = Optional . some ( self ) // Ok
224
+
225
+ let _: @Sendable ( Int ) -> X < Int > = X . init // Ok
226
+ let _: @Sendable ( Test < Int > ) -> Void = X . test // Ok
227
+ let _ = X . test ( self ) // Ok
228
+ }
229
+ }
230
+ }
You can’t perform that action at this time.
0 commit comments