Use original type parameters for SAM adapter to constructor

It makes SAM descriptors more consistent with real ones
This commit is contained in:
Denis Zharkov
2015-11-03 14:02:30 +03:00
parent d614adcd2a
commit 7b4c0fb83a
@@ -289,6 +289,10 @@ public class SingleAbstractMethodUtils {
@NotNull List<TypeParameterDescriptor> originalParameters,
@Nullable DeclarationDescriptor newOwner
) {
if (newOwner instanceof SamAdapterConstructorDescriptor) {
return new TypeParameters(originalParameters, TypeSubstitutor.EMPTY);
}
Map<TypeParameterDescriptor, TypeParameterDescriptorImpl> traitToFunTypeParameters =
JavaResolverUtils.recreateTypeParametersAndReturnMapping(originalParameters, newOwner);
TypeSubstitutor typeParametersSubstitutor = JavaResolverUtils.createSubstitutorForTypeParameters(traitToFunTypeParameters);