File tree Expand file tree Collapse file tree 2 files changed +24
-23
lines changed Expand file tree Collapse file tree 2 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -174,30 +174,9 @@ bool BindingSet::involvesTypeVariables() const {
174
174
}
175
175
176
176
bool BindingSet::isPotentiallyIncomplete () const {
177
- // Always marking generic parameter type variables as incomplete
178
- // is too aggressive. That was the way to make sure that they
179
- // are never attempted to eagerly, but really there are only a
180
- // couple of situations where that can cause issues:
181
- //
182
- // 1. Int <: $T_param
183
- // $T1 <: $T_param
184
- //
185
- // 2. $T2 conv Generic<$T_param>
186
- // $T2 conv Generic<Int?>
187
- // Int <: $T_param
188
- //
189
- // Attempting $T_param before $T1 in 1. could result in a missed
190
- // optional type binding for example.
191
- //
192
- // Attempting $T_param too early in this case (before $T2) could
193
- // miss some transitive bindings inferred through conversion
194
- // of `Generic` type.
195
- //
196
- // If a type variable that represents a generic parameter is no longer
197
- // associated with any type variables (directly or indirectly) it's safe
198
- // to assume that its binding set is complete.
177
+ // Generic parameters are always potentially incomplete.
199
178
if (Info.isGenericParameter ())
200
- return involvesTypeVariables () ;
179
+ return true ;
201
180
202
181
// Key path literal type is incomplete until there is a
203
182
// contextual type or key path is resolved enough to infer
Original file line number Diff line number Diff line change @@ -393,3 +393,25 @@ struct TestMultipleOverloadedInits {
393
393
let _ = [ Float ( x) , Float ( x) , Float ( x) , Float ( x) ]
394
394
}
395
395
}
396
+
397
+ do {
398
+ struct Section {
399
+ var rows : [ Row < Any > ] ?
400
+ }
401
+
402
+ struct Row < T> {
403
+ init ( value: T ? ) { }
404
+ }
405
+
406
+ struct Asset {
407
+ var orientation : Int32
408
+ }
409
+
410
+ func test( asset: Asset ) -> [ Section ] {
411
+ return [
412
+ Section ( rows: [
413
+ Row ( value: String ( describing: asset. orientation) ) // Ok
414
+ ] )
415
+ ]
416
+ }
417
+ }
You can’t perform that action at this time.
0 commit comments