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:
+14
@@ -37,6 +37,8 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
||||
@Nullable
|
||||
private final Pair<UserDataKey<?>, ?> singleUserData;
|
||||
|
||||
private KotlinType inType = null;
|
||||
|
||||
protected JavaPropertyDescriptor(
|
||||
@NotNull DeclarationDescriptor containingDeclaration,
|
||||
@NotNull Annotations annotations,
|
||||
@@ -172,6 +174,18 @@ public class JavaPropertyDescriptor extends PropertyDescriptorImpl implements Ja
|
||||
(!TypeEnhancementKt.hasEnhancedNullability(type) || KotlinBuiltIns.isString(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInType(@NotNull KotlinType inType) {
|
||||
this.inType = inType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable KotlinType getInType() {
|
||||
PropertySetterDescriptor setter = getSetter();
|
||||
KotlinType setterType = setter != null ? setter.getValueParameters().get(0).getType() : null;
|
||||
return setterType != null ? setterType : inType;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user