@@ -573,18 +573,6 @@ CheckRedeclarationRequest::evaluate(Evaluator &eval, ValueDecl *current) const {
573
573
&wouldBeSwift5Redeclaration);
574
574
// If there is another conflict, complain.
575
575
if (isRedeclaration || wouldBeSwift5Redeclaration) {
576
- // If the two declarations occur in the same source file, make sure
577
- // we get the diagnostic ordering to be sensible.
578
- if (auto otherFile = other->getDeclContext ()->getParentSourceFile ()) {
579
- if (currentFile == otherFile &&
580
- current->getLoc ().isValid () &&
581
- other->getLoc ().isValid () &&
582
- ctx.SourceMgr .isBeforeInBuffer (current->getLoc (),
583
- other->getLoc ())) {
584
- std::swap (current, other);
585
- }
586
- }
587
-
588
576
// If we're currently looking at a .sil and the conflicting declaration
589
577
// comes from a .sib, don't error since we won't be considering the sil
590
578
// from the .sib. So it's fine for the .sil to shadow it, since that's the
@@ -798,11 +786,6 @@ CheckRedeclarationRequest::evaluate(Evaluator &eval, ValueDecl *current) const {
798
786
}
799
787
}
800
788
801
- // Make sure we don't do this checking again for the same decl. We also
802
- // set this at the beginning of the function, but we might have swapped
803
- // the decls for diagnostics; so ensure we also set this for the actual
804
- // decl we diagnosed on.
805
- current->setCheckedRedeclaration ();
806
789
break ;
807
790
}
808
791
}
0 commit comments