Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed Jan 7, 2025
1 parent 8f0a440 commit 91faa63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions cpp/src/slice2cs/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,18 @@ Slice::CsVisitor::writeInheritedOperations(const InterfaceDefPtr& p)
OperationList allBaseOps;
for (const auto& base : p->bases())
{
OperationList tmp = base->allOperations();
allBaseOps.splice(allBaseOps.end(), tmp);
for (const auto& baseOp : base->allOperations())
{
// It's possible to get the same operation name through diamond inheritance.
// But we only want one 'copy' of each operation in our list, to avoid generating duplicate methods.
if (find_if(
allBaseOps.begin(),
allBaseOps.end(),
[name = baseOp->name()](const auto& other) { return other->name() == name; }) == allBaseOps.end())
{
allBaseOps.push_back(baseOp);
}
}
}

for (const auto& op : allBaseOps)
Expand Down Expand Up @@ -3231,7 +3241,6 @@ Slice::Gen::DispatcherVisitor::writeDispatch(const InterfaceDefPtr& p)
string scoped = p->scoped();
string ns = getNamespace(p);

OperationList ops = p->operations();
OperationList allOps = p->allOperations();
if (!allOps.empty())
{
Expand Down
1 change: 1 addition & 0 deletions cpp/src/slice2php/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
_out << "null";
}
_out << ", ";

ExceptionList exceptions = (*oli)->throws();
if (!exceptions.empty())
{
Expand Down
1 change: 0 additions & 1 deletion cpp/src/slice2swift/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,6 @@ Gen::ObjectVisitor::visitOperation(const OperationPtr& op)
const string opName = fixIdent(op->name());
const ParamInfoList allInParams = getAllInParams(op);
const ParamInfoList allOutParams = getAllOutParams(op);
const ExceptionList allExceptions = op->throws();

out << sp;
writeOpDocSummary(out, op, true);
Expand Down

0 comments on commit 91faa63

Please sign in to comment.