Rename KotlinBuiltIns.isAny -> isAnyOrNullableAny

Reduce confusion, prevent bugs
This commit is contained in:
Alexander Udalov
2013-12-11 18:03:20 +04:00
parent 0576851102
commit cc1d4a033a
6 changed files with 7 additions and 6 deletions
@@ -72,7 +72,7 @@ public class ArgumentTypeResolver {
@NotNull JetType expectedType
) {
if (actualType == PLACEHOLDER_FUNCTION_TYPE) {
return isFunctionOrErrorType(expectedType) || KotlinBuiltIns.getInstance().isAny(expectedType); //todo function type extends
return isFunctionOrErrorType(expectedType) || KotlinBuiltIns.getInstance().isAnyOrNullableAny(expectedType); //todo function type extends
}
return JetTypeChecker.INSTANCE.isSubtypeOf(actualType, expectedType);
}
@@ -217,7 +217,7 @@ public class DataFlowUtils {
@Nullable
public static JetType checkImplicitCast(@Nullable JetType expressionType, @NotNull JetExpression expression, @NotNull ExpressionTypingContext context, boolean isStatement) {
if (expressionType != null && context.expectedType == NO_EXPECTED_TYPE && context.contextDependency == INDEPENDENT && !isStatement
&& (KotlinBuiltIns.getInstance().isUnit(expressionType) || KotlinBuiltIns.getInstance().isAny(expressionType))) {
&& (KotlinBuiltIns.getInstance().isUnit(expressionType) || KotlinBuiltIns.getInstance().isAnyOrNullableAny(expressionType))) {
context.trace.report(IMPLICIT_CAST_TO_UNIT_OR_ANY.on(expression, expressionType));
}
return expressionType;