@@ -423,26 +423,6 @@ static ResolveWitnessResult resolveTypeWitnessViaLookup(
423
423
if (genericDecl->isGeneric ())
424
424
continue ;
425
425
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
-
446
426
// Skip typealiases with an unbound generic type as their underlying type.
447
427
if (auto *typeAliasDecl = dyn_cast<TypeAliasDecl>(typeDecl))
448
428
if (typeAliasDecl->getDeclaredInterfaceType ()->is <UnboundGenericType>())
@@ -461,8 +441,7 @@ static ResolveWitnessResult resolveTypeWitnessViaLookup(
461
441
462
442
// If the type comes from a constrained extension or has a 'where'
463
443
// clause, check those requirements now.
464
- if (!skipRequirementCheck &&
465
- !TypeChecker::checkContextualRequirements (
444
+ if (!TypeChecker::checkContextualRequirements (
466
445
genericDecl, dc->getSelfInterfaceType (), SourceLoc (),
467
446
dc->getParentModule (), dc->getGenericSignatureOfContext ())) {
468
447
continue ;
0 commit comments