org.jetbrains.jet.lang.resolve.calls.inference
Interface ConstraintSystemStatus


public interface ConstraintSystemStatus


Method Summary
 boolean hasConflictingConstraints()
          Returns true if type constraints for some type variable are contradicting.
 boolean hasContradiction()
          Return true if constraint system has no contradiction (it can be not successful because of the lack of information for a type variable).
 boolean hasErrorInConstrainingTypes()
          Returns true if there is an error in constraining types.
 boolean hasOnlyErrorsFromPosition(ConstraintPosition constraintPosition)
          Returns true if there is type constructor mismatch only in constraintPosition or constraint system is successful without constraints from this position.
 boolean hasTypeConstructorMismatch()
          Returns true if some constraint cannot be processed because of type constructor mismatch.
 boolean hasTypeConstructorMismatchAt(ConstraintPosition constraintPosition)
          Returns true if there is type constructor mismatch error at a specific constraintPosition.
 boolean hasUnknownParameters()
          Returns true if there is no information for some registered type variable.
 boolean hasViolatedUpperBound()
          Returns true if contradiction of type constraints comes from declared bounds for type parameters.
 boolean isSuccessful()
          Returns true if constraint system has a solution (has no contradiction and has enough information to infer each registered type variable).
 

Method Detail

isSuccessful

boolean isSuccessful()
Returns true if constraint system has a solution (has no contradiction and has enough information to infer each registered type variable).


hasContradiction

boolean hasContradiction()
Return true if constraint system has no contradiction (it can be not successful because of the lack of information for a type variable).


hasConflictingConstraints

boolean hasConflictingConstraints()
Returns true if type constraints for some type variable are contradicting.

For example, for

fun <R> foo(r: R, t: java.util.List<R>) {}
in invocation foo(1, arrayList("s")) type variable R has two conflicting constraints:

- "R is a supertype of Int"

- "List<R> is a supertype of List<String>" which leads to "R is equal to String"


hasViolatedUpperBound

boolean hasViolatedUpperBound()
Returns true if contradiction of type constraints comes from declared bounds for type parameters. For example, for
fun <R: Any> foo(r: R) {}
in invocation foo(null) upper bounds Any for type parameter R is violated.

It's the special case of 'hasConflictingConstraints' case.


hasUnknownParameters

boolean hasUnknownParameters()
Returns true if there is no information for some registered type variable. For example, for
fun <E> newList()
in invocation "val nl = newList()" there is no information to infer type variable E.


hasTypeConstructorMismatch

boolean hasTypeConstructorMismatch()
Returns true if some constraint cannot be processed because of type constructor mismatch. For example, for
fun <R> foo(t: List<R>) {}
in invocation foo(hashSet("s")) there is type constructor mismatch: "HashSet<String> cannot be a subtype of List<R>".


hasTypeConstructorMismatchAt

boolean hasTypeConstructorMismatchAt(@NotNull
                                     ConstraintPosition constraintPosition)
Returns true if there is type constructor mismatch error at a specific constraintPosition. For example, for
fun <R> foo(t: List<R>) {}
in invocation foo(hashSet("s")) there is type constructor mismatch: "HashSet<String> cannot be a subtype of List<R>" at a constraint position ConstraintPosition.getValueParameterPosition(0).


hasOnlyErrorsFromPosition

boolean hasOnlyErrorsFromPosition(ConstraintPosition constraintPosition)
Returns true if there is type constructor mismatch only in constraintPosition or constraint system is successful without constraints from this position.


hasErrorInConstrainingTypes

boolean hasErrorInConstrainingTypes()
Returns true if there is an error in constraining types.

Is used not to generate type inference error if there was one in argument types.