Skip to content

Commit af8c8f1

Browse files
committed
Sema: Remove non-experimental associated type inference
1 parent 66801fd commit af8c8f1

File tree

56 files changed

+155
-1496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+155
-1496
lines changed

include/swift/AST/ProtocolConformance.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,6 @@ class NormalProtocolConformance : public RootProtocolConformance,
747747
/// Override the witness for a given requirement.
748748
void overrideWitness(ValueDecl *requirement, Witness newWitness);
749749

750-
/// Populate the signature conformances without checking if they satisfy
751-
/// requirements. Can only be used with parsed or imported conformances.
752-
void finishSignatureConformances();
753-
754750
/// Determine whether the witness for the given type requirement
755751
/// is the default definition.
756752
bool usesDefaultDefinition(AssociatedTypeDecl *requirement) const {

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,6 @@ namespace swift {
567567
/// rewrite system.
568568
bool EnableRequirementMachineOpaqueArchetypes = false;
569569

570-
/// Enable experimental associated type inference improvements.
571-
bool EnableExperimentalAssociatedTypeInference = false;
572-
573570
/// Enable implicit lifetime dependence for ~Escapable return types.
574571
bool EnableExperimentalLifetimeDependenceInference = true;
575572

lib/AST/ProtocolConformance.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,6 @@ NormalProtocolConformance::getAssociatedConformance(Type assocType,
563563
forEachAssociatedConformance(
564564
[&](Type t, ProtocolDecl *p, unsigned index) {
565565
if (t->isEqual(assocType) && p == protocol) {
566-
if (!ctx.LangOpts.EnableExperimentalAssociatedTypeInference) {
567-
// Fill in the signature conformances, if we haven't done so yet.
568-
if (!hasComputedAssociatedConformances()) {
569-
const_cast<NormalProtocolConformance *>(this)
570-
->finishSignatureConformances();
571-
}
572-
}
573-
574566
// Not strictly necessary, but avoids a bit of request evaluator
575567
// overhead in the happy case.
576568
if (hasComputedAssociatedConformances()) {
@@ -632,28 +624,6 @@ void NormalProtocolConformance::setAssociatedConformance(
632624
AssociatedConformances[index] = assocConf;
633625
}
634626

635-
/// Collect conformances for the requirement signature.
636-
void NormalProtocolConformance::finishSignatureConformances() {
637-
if (Loader)
638-
resolveLazyInfo();
639-
640-
if (hasComputedAssociatedConformances())
641-
return;
642-
643-
createAssociatedConformanceArray();
644-
645-
auto &ctx = getDeclContext()->getASTContext();
646-
647-
forEachAssociatedConformance(
648-
[&](Type origTy, ProtocolDecl *reqProto, unsigned index) {
649-
auto canTy = origTy->getCanonicalType();
650-
evaluateOrDefault(ctx.evaluator,
651-
AssociatedConformanceRequest{this, canTy, reqProto, index},
652-
ProtocolConformanceRef::forInvalid());
653-
return false;
654-
});
655-
}
656-
657627
Witness RootProtocolConformance::getWitness(ValueDecl *requirement) const {
658628
ROOT_CONFORMANCE_SUBCLASS_DISPATCH(getWitness, (requirement))
659629
}

lib/Basic/LangOptions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ LangOptions::LangOptions() {
5151
// Default-on NoncopyableGenerics when the build-script setting is enabled.
5252
if (SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS) {
5353
Features.insert(Feature::NoncopyableGenerics);
54-
EnableExperimentalAssociatedTypeInference = true;
5554
}
5655

5756
// Enable any playground options that are enabled by default.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,13 +1390,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
13901390
if (Args.hasArg(OPT_enable_requirement_machine_opaque_archetypes))
13911391
Opts.EnableRequirementMachineOpaqueArchetypes = true;
13921392

1393-
Opts.EnableExperimentalAssociatedTypeInference = true;
1394-
1395-
if (Args.hasArg(OPT_enable_experimental_associated_type_inference))
1396-
Opts.EnableExperimentalAssociatedTypeInference = true;
1397-
if (Args.hasArg(OPT_disable_experimental_associated_type_inference))
1398-
Opts.EnableExperimentalAssociatedTypeInference = false;
1399-
14001393
if (Args.hasArg(OPT_enable_experimental_lifetime_dependence_inference))
14011394
Opts.EnableExperimentalLifetimeDependenceInference = true;
14021395
if (Args.hasArg(OPT_disable_experimental_lifetime_dependence_inference))

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,8 +1656,6 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
16561656
if (bool(requireNCGenerics)) {
16571657
genericSubInvocation.getLangOptions()
16581658
.enableFeature(Feature::NoncopyableGenerics);
1659-
genericSubInvocation.getLangOptions()
1660-
.EnableExperimentalAssociatedTypeInference = true;
16611659
}
16621660

16631661
// Pass-down the obfuscators so we can get the serialized search paths properly.

0 commit comments

Comments
 (0)