@@ -4112,22 +4112,26 @@ TypeConverter::getLoweredFormalTypes(SILDeclRef constant,
4112
4112
}
4113
4113
}
4114
4114
4115
- // C++ operators that are implemented as non-static member functions get
4116
- // imported into Swift as static methods that have an additional
4117
- // parameter for the left-hand-side operand instead of the receiver object.
4118
- // These are inout parameters and don't get bridged.
4119
- // TODO: Undo this if we stop using inout.
4120
- if (auto method = dyn_cast_or_null<clang::CXXMethodDecl>(
4121
- constant.getDecl ()->getClangDecl ())) {
4122
- if (method->isOverloadedOperator ()) {
4123
- bridgedParams.push_back (methodParams[0 ]);
4124
- methodParams = methodParams.drop_front (1 );
4115
+ auto partialFnPattern = bridgingFnPattern.getFunctionResultType ();
4116
+ for (unsigned i : indices (methodParams)) {
4117
+ // C++ operators that are implemented as non-static member functions get
4118
+ // imported into Swift as static methods that have an additional
4119
+ // parameter for the left-hand-side operand instead of the receiver
4120
+ // object. These are inout parameters and don't get bridged.
4121
+ // TODO: Undo this if we stop using inout.
4122
+ if (auto method = dyn_cast_or_null<clang::CXXMethodDecl>(
4123
+ constant.getDecl ()->getClangDecl ())) {
4124
+ if (i==0 && method->isOverloadedOperator ()) {
4125
+ bridgedParams.push_back (methodParams[0 ]);
4126
+ continue ;
4127
+ }
4125
4128
}
4126
- }
4127
4129
4128
- auto partialFnPattern = bridgingFnPattern.getFunctionResultType ();
4129
- getBridgedParams (rep, partialFnPattern, methodParams, bridgedParams,
4130
- bridging);
4130
+ auto paramPattern = partialFnPattern.getFunctionParamType (i);
4131
+ auto bridgedParam =
4132
+ getBridgedParam (rep, paramPattern, methodParams[i], bridging);
4133
+ bridgedParams.push_back (bridgedParam);
4134
+ }
4131
4135
4132
4136
bridgedResultType =
4133
4137
getBridgedResultType (rep,
0 commit comments