public static boolean shouldRecordInitializerForProperty( @NotNull VariableDescriptor variable, @NotNull KotlinType type) { if (variable.isVar() || type.isError()) return false; if (TypeUtils.acceptsNullable(type)) return true; KotlinBuiltIns builtIns = getBuiltIns(variable); return KotlinBuiltIns.isPrimitiveType(type) || KotlinTypeChecker.DEFAULT.equalTypes(builtIns.getStringType(), type) || KotlinTypeChecker.DEFAULT.equalTypes(builtIns.getNumber().getDefaultType(), type) || KotlinTypeChecker.DEFAULT.equalTypes(builtIns.getAnyType(), type); }
@NotNull public static KotlinType getPrimitiveNumberType( @NotNull IntegerValueTypeConstructor numberValueTypeConstructor, @NotNull KotlinType expectedType) { if (noExpectedType(expectedType) || expectedType.isError()) { return getDefaultPrimitiveNumberType(numberValueTypeConstructor); } for (KotlinType primitiveNumberType : numberValueTypeConstructor.getSupertypes()) { if (KotlinTypeChecker.DEFAULT.isSubtypeOf(primitiveNumberType, expectedType)) { return primitiveNumberType; } } return getDefaultPrimitiveNumberType(numberValueTypeConstructor); }
@Override public boolean isError() { return delegate.isError(); }