File tree 2 files changed +5
-12
lines changed
2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -827,10 +827,7 @@ class AssociatedTypeInference {
827
827
// / Compute a type witness without using a specific potential witness,
828
828
// / e.g., using a fixed type (from a refined protocol), default type
829
829
// / on an associated type, or deriving the type.
830
- // /
831
- // / \param allowDerived Whether to allow "derived" type witnesses.
832
- Type computeAbstractTypeWitness (AssociatedTypeDecl *assocType,
833
- bool allowDerived);
830
+ Type computeAbstractTypeWitness (AssociatedTypeDecl *assocType);
834
831
835
832
// / Substitute the current type witnesses into the given interface type.
836
833
Type substCurrentTypeWitnesses (Type type);
Original file line number Diff line number Diff line change @@ -898,8 +898,7 @@ Type AssociatedTypeInference::computeDerivedTypeWitness(
898
898
899
899
Type
900
900
AssociatedTypeInference::computeAbstractTypeWitness (
901
- AssociatedTypeDecl *assocType,
902
- bool allowDerived) {
901
+ AssociatedTypeDecl *assocType) {
903
902
// We don't have a type witness for this associated type, so go
904
903
// looking for more options.
905
904
if (Type concreteType = computeFixedTypeWitness (assocType))
@@ -910,10 +909,8 @@ AssociatedTypeInference::computeAbstractTypeWitness(
910
909
return defaultType;
911
910
912
911
// If we can derive a type witness, do so.
913
- if (allowDerived) {
914
- if (Type derivedType = computeDerivedTypeWitness (assocType))
915
- return derivedType;
916
- }
912
+ if (Type derivedType = computeDerivedTypeWitness (assocType))
913
+ return derivedType;
917
914
918
915
// If there is a generic parameter of the named type, use that.
919
916
if (auto genericSig = dc->getGenericSignatureOfContext ()) {
@@ -1197,8 +1194,7 @@ void AssociatedTypeInference::findSolutionsRec(
1197
1194
1198
1195
// Try to compute the type without the aid of a specific potential
1199
1196
// witness.
1200
- if (Type type = computeAbstractTypeWitness (assocType,
1201
- /* allowDerived=*/ true )) {
1197
+ if (Type type = computeAbstractTypeWitness (assocType)) {
1202
1198
if (type->hasError ()) {
1203
1199
recordMissing ();
1204
1200
return ;
You can’t perform that action at this time.
0 commit comments