Commit e4193ec7 authored by Andreas Pakulat's avatar Andreas Pakulat

merge r1043530:

Never transfer the default-parameters between a definition and a declaration. They are only set on the declaration. This fixes a recent regression where default-parameters either were deleted from the declaration, or were duplicated from the declaration to the definition.
parent e4f80074
......@@ -111,6 +111,7 @@ AdaptDefinitionSignatureAssistant::AdaptDefinitionSignatureAssistant(KTextEditor
}
int pos = 0;
foreach(Declaration* parameter, otherSideFunctionContext->localDeclarations()) {
m_oldSignature.defaultParams << otherFunDecl->defaultParameterForArgument(pos).str();
m_oldSignature.parameters << qMakePair(parameter->indexedType(), parameter->identifier().identifier().str());
......@@ -259,11 +260,12 @@ void AdaptDefinitionSignatureAssistant::parseJobFinished(KDevelop::ParseJob* job
AbstractFunctionDeclaration* contextFunction = dynamic_cast<AbstractFunctionDeclaration*>(decl);
foreach(Declaration* parameter, context->localDeclarations()) {
kDebug() << "parameter:" << parameter->toString() << parameter->range().textRange();
newSignature.defaultParams << contextFunction->defaultParameterForArgument(pos).str();
newSignature.parameters << qMakePair(parameter->indexedType(), parameter->identifier().identifier().str());
++pos;
}
newSignature.defaultParams = m_oldSignature.defaultParams;
KDevelop::IndexedType newReturnType;
FunctionType::Ptr funType = decl->type<FunctionType>();
if(funType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment