Refactor KotlinType::asPsiType for ultra-light classes

- Extract HOF that UltraLightSupport::mapType that allows to call
arbitrary functions of type mapper
- Use it for computing return type of functions
- "declaration: KtDeclaration" parameter became unused since it was only
used for return types
This commit is contained in:
Denis Zharkov
2018-11-15 14:40:28 +03:00
parent 06d91fd95f
commit e15e82e1a9
3 changed files with 25 additions and 20 deletions
@@ -388,7 +388,7 @@ public class KotlinTypeMapper {
}
@NotNull
private Type mapReturnType(@NotNull CallableDescriptor descriptor, @Nullable JvmSignatureWriter sw) {
public Type mapReturnType(@NotNull CallableDescriptor descriptor, @Nullable JvmSignatureWriter sw) {
KotlinType returnType = descriptor.getReturnType();
assert returnType != null : "Function has no return type: " + descriptor;