Have "in type" for java fields to be able to check that type in assignment positions (against rhs' type)

^KT-46727 Fixed
This commit is contained in:
Victor Petukhov
2021-09-23 18:11:50 +03:00
parent 3530840da3
commit 0cb56be14f
17 changed files with 368 additions and 2 deletions
@@ -371,8 +371,8 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
VariableDescriptor descriptor = BindingContextUtils.extractVariableFromResolvedCall(bindingContext, leftOperand);
if (descriptor instanceof PropertyDescriptor) {
PropertySetterDescriptor setter = ((PropertyDescriptor) descriptor).getSetter();
if (setter != null) return setter.getValueParameters().get(0).getType();
KotlinType inType = ((PropertyDescriptor) descriptor).getInType();
if (inType != null) return inType;
}
return leftOperandType;