Skip to content

Commit 4f6d7f4

Browse files
authored
Merge pull request #83986 from slavapestov/fix-rdar158774099
AST: Remove old hack that appears to be obsolete and revert a revert of another fix
2 parents 93aa8d5 + 161c6f5 commit 4f6d7f4

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -283,20 +283,6 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
283283

284284
// For each remaining step, project an associated conformance.
285285
while (iter != path.end()) {
286-
// FIXME: Remove this hack. It is unsound, because we may not have diagnosed
287-
// anything but still end up with an ErrorType in the AST.
288-
if (conformance.isConcrete()) {
289-
auto concrete = conformance.getConcrete();
290-
if (auto normal = dyn_cast<NormalProtocolConformance>(concrete->getRootConformance())) {
291-
if (!normal->hasComputedAssociatedConformances()) {
292-
if (proto->getASTContext().evaluator.hasActiveRequest(
293-
ResolveTypeWitnessesRequest{normal})) {
294-
return ProtocolConformanceRef::forInvalid();
295-
}
296-
}
297-
}
298-
}
299-
300286
const auto step = *iter++;
301287
conformance = conformance.getAssociatedConformance(step.first, step.second);
302288
}

lib/AST/TypeSubstitution.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class TypeSubstituter : public TypeTransform<TypeSubstituter> {
358358
std::optional<Type> transformLocalArchetypeType(LocalArchetypeType *local,
359359
TypePosition pos);
360360

361-
// SubstitutionMap transformSubstitutionMap(SubstitutionMap subs);
361+
SubstitutionMap transformSubstitutionMap(SubstitutionMap subs);
362362

363363
CanType transformSILField(CanType fieldTy, TypePosition pos);
364364
};
@@ -474,13 +474,10 @@ Type TypeSubstituter::transformDependentMemberType(DependentMemberType *dependen
474474
return result;
475475
}
476476

477-
// FIXME: This exposes a scalability issue; see test/SILGen/opaque_result_type_slow.swift.
478-
/*
479477
SubstitutionMap TypeSubstituter::transformSubstitutionMap(SubstitutionMap subs) {
480478
// FIXME: Take level into account? Move level down into IFS?
481479
return subs.subst(IFS);
482480
}
483-
*/
484481

485482
CanType TypeSubstituter::transformSILField(CanType fieldTy, TypePosition pos) {
486483
// Type substitution does not walk into the SILBoxType's field types, because

validation-test/compiler_crashers_2/174f557922f5c3cc.swift renamed to validation-test/compiler_crashers_2_fixed/174f557922f5c3cc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// {"kind":"typecheck","original":"2fdf1565","signature":"(anonymous namespace)::TypeSubstituter::transformDependentMemberType(swift::DependentMemberType*, swift::TypePosition)","stackOverflow":true}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
protocol a {
44
typealias b = c
55
associatedtype d: b

0 commit comments

Comments
 (0)