|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystemImpl
public class ConstraintSystemImpl
| Nested Class Summary | |
|---|---|
static class |
ConstraintSystemImpl.ConstraintKind
|
| Constructor Summary | |
|---|---|
ConstraintSystemImpl()
|
|
| Method Summary | |
|---|---|
void |
addSubtypeConstraint(JetType constrainingType,
JetType subjectType,
ConstraintPosition constraintPosition)
Adds a constraint that the constraining type is a subtype of the subject type. Asserts that only subject type may contain registered type variables. |
void |
addSupertypeConstraint(JetType constrainingType,
JetType subjectType,
ConstraintPosition constraintPosition)
Adds a constraint that the constraining type is a supertype of the subject type. |
ConstraintSystem |
copy()
|
static JetType |
createCorrespondingExtensionFunctionType(JetType functionType,
JetType receiverType)
|
ConstraintSystem |
filterConstraints(com.intellij.openapi.util.Condition<ConstraintPosition> condition)
|
ConstraintSystem |
filterConstraintsOut(ConstraintPosition... excludePositions)
|
TypeSubstitutor |
getCurrentSubstitutor()
Returns a current result of solving the constraint system (mapping from the type variable to the resulting type projection). |
TypeSubstitutor |
getResultingSubstitutor()
Returns a result of solving the constraint system (mapping from the type variable to the resulting type projection). |
ConstraintSystemStatus |
getStatus()
|
ConstraintSystem |
getSystemWithoutWeakConstraints()
|
TypeBounds |
getTypeBounds(TypeParameterDescriptor typeVariable)
Returns the resulting type constraints of solving the constraint system for specific type variable. |
java.util.Set<TypeParameterDescriptor> |
getTypeVariables()
Returns a set of all registered type variables. |
void |
processDeclaredBoundConstraints()
|
void |
registerTypeVariables(java.util.Map<TypeParameterDescriptor,Variance> typeVariables)
Registers variables in a constraint system. |
ConstraintSystem |
substituteTypeVariables(com.google.common.base.Function<TypeParameterDescriptor,TypeParameterDescriptor> typeVariablesMap)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConstraintSystemImpl()
| Method Detail |
|---|
@NotNull public ConstraintSystemStatus getStatus()
getStatus in interface ConstraintSystem
public void registerTypeVariables(@NotNull
java.util.Map<TypeParameterDescriptor,Variance> typeVariables)
ConstraintSystem
registerTypeVariables in interface ConstraintSystem@NotNull public ConstraintSystem copy()
copy in interface ConstraintSystem
@NotNull
public ConstraintSystem substituteTypeVariables(@NotNull
com.google.common.base.Function<TypeParameterDescriptor,TypeParameterDescriptor> typeVariablesMap)
@NotNull
public ConstraintSystem filterConstraintsOut(@NotNull
ConstraintPosition... excludePositions)
@NotNull
public ConstraintSystem filterConstraints(@NotNull
com.intellij.openapi.util.Condition<ConstraintPosition> condition)
@NotNull public ConstraintSystem getSystemWithoutWeakConstraints()
public void addSupertypeConstraint(@Nullable
JetType constrainingType,
@NotNull
JetType subjectType,
@NotNull
ConstraintPosition constraintPosition)
ConstraintSystem"fun <T> create() : T" to infer T in invocation "val i: Int = create()"
should be generated a constraint "Int is a supertype of T" where T is a subject type, and Int is a constraining type.
addSupertypeConstraint in interface ConstraintSystem
public void addSubtypeConstraint(@Nullable
JetType constrainingType,
@NotNull
JetType subjectType,
@NotNull
ConstraintPosition constraintPosition)
ConstraintSystem"fun <T> id(t: T) {}" to infer T in invocation "id(1)"
should be generated a constraint "Int is a subtype of T" where T is a subject type, and Int is a constraining type.
addSubtypeConstraint in interface ConstraintSystempublic void processDeclaredBoundConstraints()
@NotNull public java.util.Set<TypeParameterDescriptor> getTypeVariables()
ConstraintSystem
getTypeVariables in interface ConstraintSystem
@NotNull
public TypeBounds getTypeBounds(@NotNull
TypeParameterDescriptor typeVariable)
ConstraintSystem
getTypeBounds in interface ConstraintSystem@NotNull public TypeSubstitutor getResultingSubstitutor()
ConstraintSystem
getResultingSubstitutor in interface ConstraintSystem@NotNull public TypeSubstitutor getCurrentSubstitutor()
ConstraintSystem
getCurrentSubstitutor in interface ConstraintSystem
@NotNull
public static JetType createCorrespondingExtensionFunctionType(@NotNull
JetType functionType,
@NotNull
JetType receiverType)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||