Skip to content

Commit 401f3f3

Browse files
committed
Revert "[CSBindings] Mark generic parameter type vars as complete if they don't have any adjacent vars"
This reverts commit 22e0f4a. Resolves: rdar://135203192
1 parent 00eee36 commit 401f3f3

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -174,30 +174,9 @@ bool BindingSet::involvesTypeVariables() const {
174174
}
175175

176176
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.
199178
if (Info.isGenericParameter())
200-
return involvesTypeVariables();
179+
return true;
201180

202181
// Key path literal type is incomplete until there is a
203182
// contextual type or key path is resolved enough to infer

0 commit comments

Comments
 (0)