@@ -423,26 +423,6 @@ static ResolveWitnessResult resolveTypeWitnessViaLookup(
423423 if (genericDecl->isGeneric ())
424424 continue ;
425425
426- // As a narrow fix for a source compatibility issue with SwiftUI's
427- // swiftinterface, allow a 'typealias' type witness with an underlying type
428- // of 'Never' if it is declared in a context that does not satisfy the
429- // requirements of the conformance context.
430- //
431- // FIXME: Remove this eventually.
432- bool skipRequirementCheck = false ;
433- if (auto *typeAliasDecl = dyn_cast<TypeAliasDecl>(typeDecl)) {
434- if (typeAliasDecl->getParentModule ()->getName ().is (" SwiftUI" ) &&
435- typeAliasDecl->getParentSourceFile () &&
436- typeAliasDecl->getParentSourceFile ()->Kind == SourceFileKind::Interface) {
437- if (typeAliasDecl->getUnderlyingType ()->isNever ()) {
438- if (typeAliasDecl->getDeclContext ()->getSelfNominalTypeDecl () ==
439- dc->getSelfNominalTypeDecl ()) {
440- skipRequirementCheck = true ;
441- }
442- }
443- }
444- }
445-
446426 // Skip typealiases with an unbound generic type as their underlying type.
447427 if (auto *typeAliasDecl = dyn_cast<TypeAliasDecl>(typeDecl))
448428 if (typeAliasDecl->getDeclaredInterfaceType ()->is <UnboundGenericType>())
@@ -461,8 +441,7 @@ static ResolveWitnessResult resolveTypeWitnessViaLookup(
461441
462442 // If the type comes from a constrained extension or has a 'where'
463443 // clause, check those requirements now.
464- if (!skipRequirementCheck &&
465- !TypeChecker::checkContextualRequirements (
444+ if (!TypeChecker::checkContextualRequirements (
466445 genericDecl, dc->getSelfInterfaceType (), SourceLoc (),
467446 dc->getParentModule (), dc->getGenericSignatureOfContext ())) {
468447 continue ;
0 commit comments