@@ -755,36 +755,6 @@ class ApplyClassifier {
755
755
}
756
756
}
757
757
758
- if (fnRef.getRethrowingKind () == FunctionRethrowingKind::ByConformance) {
759
- auto substitutions = fnRef.getSubstitutions ();
760
- bool classifiedAsThrows = false ;
761
- for (auto conformanceRef : substitutions.getConformances ()) {
762
- if (conformanceRef.classifyAsThrows ()) {
763
- classifiedAsThrows = true ;
764
- break ;
765
- }
766
- }
767
-
768
- if (classifiedAsThrows) {
769
- // multiple passes can occur, so ensure that any sub-expressions of this
770
- // call are marked as throws to mimic the closure variant.
771
- if (auto subExpr = dyn_cast<ApplyExpr>(E->getFn ())) {
772
- if (!subExpr->isThrowsSet ()) {
773
- subExpr->setThrows (true );
774
- }
775
- }
776
- return Classification::forRethrowingOnly (
777
- PotentialThrowReason::forRethrowsConformance (E), isAsync);
778
- }
779
- } else if (fnRef.isBodyRethrows () &&
780
- fnRef.getRethrowingKind () == FunctionRethrowingKind::Throws) {
781
- return Classification::forThrow (PotentialThrowReason::forThrowingApply (),
782
- isAsync);
783
- } else if (fnRef.isBodyRethrows () &&
784
- fnRef.getRethrowingKind () == FunctionRethrowingKind::None) {
785
- return isAsync ? Classification::forAsync () : Classification ();
786
- }
787
-
788
758
// If the function doesn't throw at all, we're done here.
789
759
if (!fnType->isThrowing ()) {
790
760
return isAsync ? Classification::forAsync () : Classification ();
@@ -814,6 +784,16 @@ class ApplyClassifier {
814
784
isAsync);
815
785
}
816
786
787
+ if (fnRef.getRethrowingKind () == FunctionRethrowingKind::ByConformance) {
788
+ auto substitutions = fnRef.getSubstitutions ();
789
+ for (auto conformanceRef : substitutions.getConformances ()) {
790
+ if (conformanceRef.classifyAsThrows ()) {
791
+ return Classification::forRethrowingOnly (
792
+ PotentialThrowReason::forRethrowsConformance (E), isAsync);
793
+ }
794
+ }
795
+ }
796
+
817
797
// If the function's body is 'rethrows' for the number of
818
798
// arguments we gave it, apply the rethrows logic.
819
799
if (fnRef.isBodyRethrows ()) {
0 commit comments