rename
This commit is contained in:
@@ -26,7 +26,6 @@ import org.jetbrains.jet.lang.resolve.TraceUtil;
|
|||||||
import org.jetbrains.jet.lang.resolve.calls.context.CallResolutionContext;
|
import org.jetbrains.jet.lang.resolve.calls.context.CallResolutionContext;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
|
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintsUtil;
|
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintsUtil;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
|
||||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallImpl;
|
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallImpl;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument;
|
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionCandidate;
|
import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionCandidate;
|
||||||
@@ -40,7 +39,7 @@ import java.util.Map;
|
|||||||
public class CallResolverUtil {
|
public class CallResolverUtil {
|
||||||
|
|
||||||
public static final JetType DONT_CARE = ErrorUtils.createErrorTypeWithCustomDebugName("DONT_CARE");
|
public static final JetType DONT_CARE = ErrorUtils.createErrorTypeWithCustomDebugName("DONT_CARE");
|
||||||
public static final JetType CANT_INFER = ErrorUtils.createErrorTypeWithCustomDebugName("CANT_INFER");
|
public static final JetType CANT_INFER_TYPE_PARAMETER = ErrorUtils.createErrorTypeWithCustomDebugName("CANT_INFER_TYPE_PARAMETER");
|
||||||
public static final JetType PLACEHOLDER_FUNCTION_TYPE = ErrorUtils.createErrorTypeWithCustomDebugName("PLACEHOLDER_FUNCTION_TYPE");
|
public static final JetType PLACEHOLDER_FUNCTION_TYPE = ErrorUtils.createErrorTypeWithCustomDebugName("PLACEHOLDER_FUNCTION_TYPE");
|
||||||
|
|
||||||
public static enum ResolveArgumentsMode {
|
public static enum ResolveArgumentsMode {
|
||||||
@@ -84,7 +83,7 @@ public class CallResolverUtil {
|
|||||||
// last argument is return type of function type
|
// last argument is return type of function type
|
||||||
List<TypeProjection> functionParameters = arguments.subList(0, arguments.size() - 1);
|
List<TypeProjection> functionParameters = arguments.subList(0, arguments.size() - 1);
|
||||||
for (TypeProjection functionParameter : functionParameters) {
|
for (TypeProjection functionParameter : functionParameters) {
|
||||||
if (TypeUtils.equalsOrContainsAsArgument(functionParameter.getType(), CANT_INFER, DONT_CARE)) {
|
if (TypeUtils.equalsOrContainsAsArgument(functionParameter.getType(), CANT_INFER_TYPE_PARAMETER, DONT_CARE)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -43,7 +43,7 @@ import static org.jetbrains.jet.lang.resolve.calls.inference.TypeConstraintsImpl
|
|||||||
|
|
||||||
public class ConstraintSystemImpl implements ConstraintSystem {
|
public class ConstraintSystemImpl implements ConstraintSystem {
|
||||||
|
|
||||||
public static enum ConstraintKind {
|
public enum ConstraintKind {
|
||||||
SUB_TYPE, EQUAL
|
SUB_TYPE, EQUAL
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
|||||||
private boolean hasExpectedTypeMismatch;
|
private boolean hasExpectedTypeMismatch;
|
||||||
|
|
||||||
public ConstraintSystemImpl() {
|
public ConstraintSystemImpl() {
|
||||||
this.resultingSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(CANT_INFER));
|
this.resultingSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(CANT_INFER_TYPE_PARAMETER));
|
||||||
this.currentSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(DONT_CARE));
|
this.currentSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(DONT_CARE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
|||||||
private boolean isErrorOrSpecialType(@Nullable JetType type) {
|
private boolean isErrorOrSpecialType(@Nullable JetType type) {
|
||||||
if (type == TypeUtils.NO_EXPECTED_TYPE
|
if (type == TypeUtils.NO_EXPECTED_TYPE
|
||||||
|| type == DONT_CARE
|
|| type == DONT_CARE
|
||||||
|| type == CANT_INFER) {
|
|| type == CANT_INFER_TYPE_PARAMETER) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
|||||||
|
|
||||||
// can be equal for the recursive invocations:
|
// can be equal for the recursive invocations:
|
||||||
// fun <T> foo(i: Int) : T { ... return foo(i); } => T <: T
|
// fun <T> foo(i: Int) : T { ... return foo(i); } => T <: T
|
||||||
if (subType == superType) return;
|
if (subType.equals(superType)) return;
|
||||||
|
|
||||||
assert !isMyTypeVariable(subType) || !isMyTypeVariable(superType) :
|
assert !isMyTypeVariable(subType) || !isMyTypeVariable(superType) :
|
||||||
"The constraint shouldn't contain different type variables on both sides: " + subType + " <: " + superType;
|
"The constraint shouldn't contain different type variables on both sides: " + subType + " <: " + superType;
|
||||||
|
|||||||
+4
-4
@@ -40,7 +40,7 @@ import java.util.List;
|
|||||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||||
import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
||||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||||
import static org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils.CANNOT_BE_INFERRED;
|
import static org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils.CANT_INFER_LAMBDA_PARAM_TYPE;
|
||||||
|
|
||||||
public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
||||||
protected ClosureExpressionsTypingVisitor(@NotNull ExpressionTypingInternals facade) {
|
protected ClosureExpressionsTypingVisitor(@NotNull ExpressionTypingInternals facade) {
|
||||||
@@ -219,14 +219,14 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (expectedType == null || expectedType == CallResolverUtil.DONT_CARE || expectedType == CallResolverUtil.CANT_INFER) {
|
if (expectedType == null || expectedType == CallResolverUtil.DONT_CARE || expectedType == CallResolverUtil.CANT_INFER_TYPE_PARAMETER) {
|
||||||
context.trace.report(CANNOT_INFER_PARAMETER_TYPE.on(declaredParameter));
|
context.trace.report(CANNOT_INFER_PARAMETER_TYPE.on(declaredParameter));
|
||||||
}
|
}
|
||||||
if (expectedType != null) {
|
if (expectedType != null) {
|
||||||
type = expectedType;
|
type = expectedType;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
type = CANNOT_BE_INFERRED;
|
type = CANT_INFER_LAMBDA_PARAM_TYPE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return context.expressionTypingServices.getDescriptorResolver().resolveValueParameterDescriptor(
|
return context.expressionTypingServices.getDescriptorResolver().resolveValueParameterDescriptor(
|
||||||
@@ -257,7 +257,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
return KotlinBuiltIns.getInstance().getUnitType();
|
return KotlinBuiltIns.getInstance().getUnitType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnType == null ? CANNOT_BE_INFERRED : returnType;
|
return returnType == null ? CANT_INFER_LAMBDA_PARAM_TYPE : returnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ public class ExpressionTypingUtils {
|
|||||||
private ExpressionTypingUtils() {
|
private ExpressionTypingUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final JetType CANNOT_BE_INFERRED = ErrorUtils.createErrorType("Cannot be inferred");
|
public static final JetType CANT_INFER_LAMBDA_PARAM_TYPE = ErrorUtils.createErrorType("Cannot be inferred");
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected static ExpressionReceiver getExpressionReceiver(@NotNull JetExpression expression, @Nullable JetType type) {
|
protected static ExpressionReceiver getExpressionReceiver(@NotNull JetExpression expression, @Nullable JetType type) {
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String renderTypeWithoutEscape(@NotNull JetType type) {
|
private String renderTypeWithoutEscape(@NotNull JetType type) {
|
||||||
if (type == ExpressionTypingUtils.CANNOT_BE_INFERRED || type == CallResolverUtil.CANT_INFER) {
|
if (type == ExpressionTypingUtils.CANT_INFER_LAMBDA_PARAM_TYPE || type == CallResolverUtil.CANT_INFER_TYPE_PARAMETER) {
|
||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
if (ErrorUtils.isErrorType(type)) {
|
if (ErrorUtils.isErrorType(type)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user