Delegate properties break "Debug..." and "Run..." actions when type is specified
#KT-3594 Fixed
This commit is contained in:
@@ -189,11 +189,15 @@ public class ResolveSessionUtils {
|
||||
PropertyDescriptor descriptor = (PropertyDescriptor) resolveSession.resolveToDescriptor(jetProperty);
|
||||
|
||||
JetExpression propertyInitializer = jetProperty.getInitializer();
|
||||
|
||||
if (propertyInitializer != null) {
|
||||
bodyResolver.resolvePropertyInitializer(jetProperty, descriptor, propertyInitializer, propertyResolutionScope);
|
||||
}
|
||||
|
||||
JetExpression propertyDelegate = jetProperty.getDelegateExpression();
|
||||
if (propertyDelegate != null) {
|
||||
bodyResolver.resolvePropertyDelegate(jetProperty, descriptor, propertyDelegate, propertyResolutionScope, propertyResolutionScope);
|
||||
}
|
||||
|
||||
bodyResolver.resolvePropertyAccessors(jetProperty, descriptor);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -88,11 +88,9 @@ public class DelegatedPropertyUtils {
|
||||
scope, true);
|
||||
JetType returnType = getDelegateGetMethodReturnType(trace.getBindingContext(), propertyDescriptor);
|
||||
JetType propertyType = propertyDescriptor.getType();
|
||||
if (propertyType instanceof DeferredType) {
|
||||
assert ((DeferredType) propertyType).isComputed() : "Property type should be computed when resolving delegate convention method";
|
||||
}
|
||||
|
||||
if (returnType != null && !JetTypeChecker.INSTANCE.isSubtypeOf(returnType, propertyType)) {
|
||||
/* Do not check return type of get() method of delegate for properties with DeferredType because property type is taken from it */
|
||||
if (!(propertyType instanceof DeferredType) && returnType != null && !JetTypeChecker.INSTANCE.isSubtypeOf(returnType, propertyType)) {
|
||||
Call call = trace.getBindingContext().get(DELEGATED_PROPERTY_CALL, propertyDescriptor.getGetter());
|
||||
assert call != null : "Call should exists for " + propertyDescriptor.getGetter();
|
||||
trace.report(DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH
|
||||
|
||||
Reference in New Issue
Block a user