Skip to content

Commit ef77e6c

Browse files
committed
Sema: Simplify some logic in OpaqueResultTypeRequest::evaluate()
1 parent 1c849cf commit ef77e6c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

lib/Sema/TypeCheckGeneric.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,9 @@ OpaqueResultTypeRequest::evaluate(Evaluator &evaluator,
258258
return nullptr;
259259
}
260260

261-
if (constraintType->hasArchetype())
262-
constraintType = constraintType->mapTypeOutOfContext();
263-
264-
if (constraintType->getClassOrBoundGenericClass()) {
265-
requirements.push_back(
266-
Requirement(RequirementKind::Superclass, paramType,
267-
constraintType));
268-
} else {
269-
// In this case, the constraint type is an existential
270-
requirements.push_back(
271-
Requirement(RequirementKind::Conformance, paramType,
272-
constraintType));
273-
}
261+
assert(!constraintType->hasArchetype());
262+
requirements.emplace_back(RequirementKind::Conformance, paramType,
263+
constraintType);
274264
}
275265

276266
interfaceSignature = buildGenericSignature(ctx, outerGenericSignature,

0 commit comments

Comments
 (0)