提交 7a5d69b0 编写于 作者: M Maxim Shafirov

Cloning a constructor descriptor shall result in constructor descriptor, not FunctionDescriptor

上级 a61e045e
......@@ -96,11 +96,21 @@ public class FunctionDescriptorUtil {
if (substitutor.isEmpty()) {
return functionDescriptor;
}
FunctionDescriptorImpl substitutedDescriptor = new FunctionDescriptorImpl(
functionDescriptor,
// TODO : safeSubstitute
functionDescriptor.getAttributes(),
functionDescriptor.getName());
FunctionDescriptorImpl substitutedDescriptor;
if (functionDescriptor instanceof ConstructorDescriptor) {
ConstructorDescriptor original = (ConstructorDescriptor) functionDescriptor;
substitutedDescriptor = new ConstructorDescriptorImpl(
original, functionDescriptor.getAttributes(), original.isPrimary()
);
}
else {
substitutedDescriptor = new FunctionDescriptorImpl(
functionDescriptor,
// TODO : safeSubstitute
functionDescriptor.getAttributes(),
functionDescriptor.getName());
}
List<ValueParameterDescriptor> substitutedValueParameters = getSubstitutedValueParameters(substitutedDescriptor, functionDescriptor, substitutor);
if (substitutedValueParameters == null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册