@@ -2257,12 +2257,6 @@ namespace {
2257
2257
// / Produce a deterministic ordering of the given declarations.
2258
2258
struct OrderDeclarations {
2259
2259
bool operator ()(ValueDecl *lhs, ValueDecl *rhs) const {
2260
- // If one declaration is imported from ObjC and the other is native Swift,
2261
- // put the imported Clang one first.
2262
- if (lhs->hasClangNode () != rhs->hasClangNode ()) {
2263
- return lhs->hasClangNode ();
2264
- }
2265
-
2266
2260
// If the declarations come from different modules, order based on the
2267
2261
// module.
2268
2262
ModuleDecl *lhsModule = lhs->getDeclContext ()->getParentModule ();
@@ -2512,10 +2506,6 @@ bool swift::diagnoseObjCMethodConflicts(SourceFile &sf) {
2512
2506
RULE (!isa<ExtensionDecl>(a->getDeclContext ()),
2513
2507
!isa<ExtensionDecl>(b->getDeclContext ()));
2514
2508
2515
- // Is one of these imported from Objective-C?
2516
- RULE (a->hasClangNode (),
2517
- b->hasClangNode ());
2518
-
2519
2509
// Are these from different source files? If so, fall back to the order in
2520
2510
// which the declarations were type checked.
2521
2511
// FIXME: This is gross and nondeterministic.
@@ -2544,28 +2534,16 @@ bool swift::diagnoseObjCMethodConflicts(SourceFile &sf) {
2544
2534
if (auto accessor = dyn_cast<AccessorDecl>(originalMethod))
2545
2535
originalDecl = accessor->getStorage ();
2546
2536
2547
- // Conflicts between two imported ObjC methods are caused by the same
2548
- // clang decl having several Swift names.
2549
- if (originalDecl->hasClangNode () && conflictingDecl->hasClangNode ())
2550
- continue ;
2551
-
2552
- bool breakingInSwift5 = false ;
2553
- // Imported ObjC async methods weren't fully checked for selector
2554
- // conflicts until 5.7.
2555
- if (originalMethod->hasClangNode () && originalMethod->hasAsync ())
2556
- breakingInSwift5 = true ;
2557
- // Protocols weren't checked for selector conflicts in 5.0.
2558
- if (!isa<ClassDecl>(conflict.typeDecl ))
2559
- breakingInSwift5 = true ;
2560
-
2561
2537
bool redeclSame = (diagInfo == origDiagInfo);
2562
2538
auto diag = Ctx.Diags .diagnose (conflictingDecl,
2563
2539
redeclSame ? diag::objc_redecl_same
2564
2540
: diag::objc_redecl,
2565
2541
diagInfo.first , diagInfo.second ,
2566
2542
origDiagInfo.first , origDiagInfo.second ,
2567
2543
conflict.selector );
2568
- diag.warnUntilSwiftVersionIf (breakingInSwift5, 6 );
2544
+
2545
+ // Protocols weren't checked for selector conflicts in 5.0.
2546
+ diag.warnUntilSwiftVersionIf (!isa<ClassDecl>(conflict.typeDecl ), 6 );
2569
2547
2570
2548
auto objcAttr = getObjCAttrIfFromAccessNote (conflictingDecl);
2571
2549
swift::softenIfAccessNote (conflictingDecl, objcAttr, diag);
0 commit comments