Skip to content

Commit 5b2f2cb

Browse files
committed
NCGenerics: remove the reverse-condfail workaround
This should no longer be needed, after having staged the first set of changes in, as it was a temporary workaround. resolves rdar://131560183
1 parent 591891f commit 5b2f2cb

File tree

6 files changed

+1
-53
lines changed

6 files changed

+1
-53
lines changed

docs/Generics/chapters/class-inheritance.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
\item The witness must be in a protocol extension. If the witness is a method on the class, there is no way to observe the concrete substitution for the protocol \texttt{Self} type, because it is not a generic parameter of the class method.
453453
\item (The hack) The interface type of the protocol requirement must not mention any associated types.
454454
\end{enumerate}
455-
The determination of whether to use a static or covariant \texttt{Self} type for a class conformance is implemented by the type cheker function \texttt{matchWitness()}.
455+
The determination of whether to use a static or covariant \texttt{Self} type for a class conformance is implemented by the type checker function \texttt{matchWitness()}.
456456

457457
Indeed, Condition~3 is a hack; it opens up an exception where the soundness hole we worked so hard to close is once again allowed. In an ideal world, Conditions 1~and~2 would be sufficient, but by the time the soundness hole was discovered and closed, existing code had already been written taking advantage of it. The scenario necessitating Condition~3 is when the default implementation appears in a \emph{constrained} protocol extension:
458458
\begin{Verbatim}

include/swift/Basic/Features.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,6 @@ EXPERIMENTAL_FEATURE(DebugDescriptionMacro, true)
395395

396396
EXPERIMENTAL_FEATURE(ReinitializeConsumeInMultiBlockDefer, false)
397397

398-
EXPERIMENTAL_FEATURE(SE427NoInferenceOnExtension, false)
399-
400398
#undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE
401399
#undef EXPERIMENTAL_FEATURE
402400
#undef UPCOMING_FEATURE

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ static bool usesFeatureSensitive(Decl *decl) {
765765

766766
UNINTERESTING_FEATURE(DebugDescriptionMacro)
767767
UNINTERESTING_FEATURE(ReinitializeConsumeInMultiBlockDefer)
768-
UNINTERESTING_FEATURE(SE427NoInferenceOnExtension)
769768

770769
// ----------------------------------------------------------------------------
771770
// MARK: - FeatureSet

lib/Sema/TypeCheckGeneric.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -788,15 +788,6 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
788788
// to invertible protocols. This forces people to write out the conditions.
789789
inferInvertibleReqs = !ext->isAddingConformanceToInvertible();
790790

791-
// FIXME: to workaround a reverse condfail, always infer the requirements if
792-
// the extension is in a swiftinterface file. This is temporary and should
793-
// be removed soon. (rdar://130424971)
794-
if (auto *sf = ext->getOutermostParentSourceFile()) {
795-
if (sf->Kind == SourceFileKind::Interface
796-
&& !ctx.LangOpts.hasFeature(Feature::SE427NoInferenceOnExtension))
797-
inferInvertibleReqs = true;
798-
}
799-
800791
collectAdditionalExtensionRequirements(ext->getExtendedType(), extraReqs);
801792

802793
auto *extendedNominal = ext->getExtendedNominal();

test/ModuleInterface/noncopyable_generics.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
// RUN: %empty-directory(%t)
22

3-
// Due to SE427NoInferenceOnExtension not being in production
4-
// REQUIRES: asserts
5-
63
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \
74
// RUN: -enable-experimental-feature SuppressedAssociatedTypes \
85
// RUN: -enable-experimental-feature NonescapableTypes \
9-
// RUN: -enable-experimental-feature SE427NoInferenceOnExtension \
106
// RUN: -o %t/NoncopyableGenerics_Misc.swiftmodule \
117
// RUN: -emit-module-interface-path %t/NoncopyableGenerics_Misc.swiftinterface \
128
// RUN: %S/Inputs/NoncopyableGenerics_Misc.swift
139

1410
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \
1511
// RUN: -enable-experimental-feature SuppressedAssociatedTypes \
1612
// RUN: -enable-experimental-feature NonescapableTypes \
17-
// RUN: -enable-experimental-feature SE427NoInferenceOnExtension \
1813
// RUN: -o %t/Swiftskell.swiftmodule \
1914
// RUN: -emit-module-interface-path %t/Swiftskell.swiftinterface \
2015
// RUN: %S/../Inputs/Swiftskell.swift
@@ -29,19 +24,16 @@
2924
// RUN: %target-swift-frontend -compile-module-from-interface \
3025
// RUN: -enable-experimental-feature SuppressedAssociatedTypes \
3126
// RUN: -enable-experimental-feature NonescapableTypes \
32-
// RUN: -enable-experimental-feature SE427NoInferenceOnExtension \
3327
// RUN: %t/NoncopyableGenerics_Misc.swiftinterface -o %t/NoncopyableGenerics_Misc.swiftmodule
3428

3529
// RUN: %target-swift-frontend -compile-module-from-interface \
3630
// RUN: -enable-experimental-feature SuppressedAssociatedTypes \
3731
// RUN: -enable-experimental-feature NonescapableTypes \
38-
// RUN: -enable-experimental-feature SE427NoInferenceOnExtension \
3932
// RUN: %t/Swiftskell.swiftinterface -o %t/Swiftskell.swiftmodule
4033

4134
// RUN: %target-swift-frontend -emit-silgen -I %t %s \
4235
// RUN: -enable-experimental-feature SuppressedAssociatedTypes \
4336
// RUN: -enable-experimental-feature NonescapableTypes \
44-
// RUN: -enable-experimental-feature SE427NoInferenceOnExtension \
4537
// RUN: -o %t/final.silgen
4638

4739
// RUN: %FileCheck %s --check-prefix=CHECK-SILGEN < %t/final.silgen

test/ModuleInterface/noncopyable_generics_interface_extensions.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)