public class TypeConformanceComputer extends RawTypeConformanceComputer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
TypeConformanceComputer.MaxDistanceRawTypeAcceptor
Populates a
Multiset with the maximum number of necessary steps
from a given type to its super types. |
ALLOW_BOXING, ALLOW_BOXING_UNBOXING, ALLOW_FUNCTION_CONVERSION, ALLOW_PRIMITIVE_WIDENING, ALLOW_RAW_TYPE_CONVERSION, ALLOW_SYNONYMS, ALLOW_UNBOXING, AS_NESTED_TYPE_ARGUMENT, AS_TYPE_ARGUMENT, BOXING, DEMAND_CONVERSION, INCOMPATIBLE, PRIMITIVE_WIDENING, RAW_TYPE, RAW_TYPE_CONVERSION, SUBTYPE, SUCCESS, SYNONYM, UNBOUND_COMPUTATION_ADDS_HINTS, UNBOXING, UNKNOWN_TYPE_PARTICIPATED| Constructor and Description |
|---|
TypeConformanceComputer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponentType(LightweightTypeReference reference,
java.util.List<LightweightTypeReference> result) |
protected LightweightTypeReference |
conformsToAll(LightweightTypeReference type,
java.util.List<LightweightTypeReference> types) |
protected boolean |
containsPrimitiveOrAnyReferences(java.util.List<LightweightTypeReference> types) |
protected void |
cumulateDistance(java.util.List<LightweightTypeReference> references,
com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all,
com.google.common.collect.Multiset<org.eclipse.xtext.common.types.JvmType> cumulatedDistance)
Keeps the cumulated distance for all the common raw super types of the given references.
|
protected int |
doIsConformant(FunctionTypeReference left,
FunctionTypeReference right,
int flags) |
protected int |
doIsConformantOuterType(LightweightTypeReference left,
LightweightTypeReference right,
int flags) |
protected int |
doIsConformantTypeArguments(LightweightTypeReference left,
LightweightTypeReference right,
int flags)
This is a hook for the
TypeConformanceComputer to implement the type argument check. |
protected boolean |
enhanceSuperType(java.util.List<LightweightTypeReference> superTypes,
java.util.List<LightweightTypeReference> initiallyRequested,
ParameterizedTypeReference result) |
LightweightTypeReference |
getCommonParameterSuperType(java.util.List<LightweightTypeReference> types,
java.util.List<LightweightTypeReference> initiallyRequested,
ITypeReferenceOwner owner) |
LightweightTypeReference |
getCommonSuperType(java.util.List<LightweightTypeReference> types,
ITypeReferenceOwner owner)
Compute the common super type for the given types.
|
protected LightweightTypeReference |
getFirstForRawType(com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all,
org.eclipse.xtext.common.types.JvmType rawType) |
LightweightTypeReference |
getMostSpecialType(java.util.List<LightweightTypeReference> candidates) |
protected LightweightTypeReference |
getSuperType(ParameterizedTypeReference current,
org.eclipse.xtext.common.types.JvmType type)
This is a hook for the
TypeConformanceComputer to provide the resolved super type. |
protected LightweightTypeReference |
getTypeParametersForSupertype(com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all,
org.eclipse.xtext.common.types.JvmType rawType,
ITypeReferenceOwner owner,
java.util.List<LightweightTypeReference> initiallyRequested) |
protected void |
initializeDistance(LightweightTypeReference firstType,
com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all,
com.google.common.collect.Multiset<org.eclipse.xtext.common.types.JvmType> cumulatedDistance) |
protected void |
inplaceSortByDistanceAndName(java.util.List<com.google.common.collect.Multiset.Entry<org.eclipse.xtext.common.types.JvmType>> candidates) |
protected boolean |
isClass(org.eclipse.xtext.common.types.JvmType type) |
boolean |
isConformant(LightweightTypeReference left,
LightweightTypeReference right) |
int |
isConformant(LightweightTypeReference left,
LightweightTypeReference right,
int flags) |
int |
isConformant(LightweightTypeReference left,
LightweightTypeReference right,
TypeConformanceComputationArgument argument) |
protected boolean |
isRecursiveRequest(java.util.List<LightweightTypeReference> types,
java.util.Set<java.lang.String> allNames,
java.util.List<LightweightTypeReference> initiallyRequested) |
protected java.util.List<LightweightTypeReference> |
replacePrimitivesAndRemoveAnyReferences(java.util.List<LightweightTypeReference> types) |
protected int |
toFlags(TypeConformanceComputationArgument argument) |
addHintAndAnnounceSuccess, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformant, doIsConformantOuter, doIsConformantToAnyType, internalGetPrimitiveKindFromWrapper, isAssignableAsFunctionType, isConformantMergeResult, isConformantToConstraints, isSynonymConformant, setSynonymTypesProvider, tryResolveAndCheckConformance, tryResolveAndCheckConformancepublic boolean isConformant(LightweightTypeReference left, LightweightTypeReference right)
public int isConformant(LightweightTypeReference left, LightweightTypeReference right, TypeConformanceComputationArgument argument)
protected int toFlags(TypeConformanceComputationArgument argument)
public int isConformant(LightweightTypeReference left, LightweightTypeReference right, int flags)
isConformant in class RawTypeConformanceComputerprotected LightweightTypeReference getSuperType(ParameterizedTypeReference current, org.eclipse.xtext.common.types.JvmType type)
RawTypeConformanceComputerTypeConformanceComputer to provide the resolved super type.getSuperType in class RawTypeConformanceComputerprotected int doIsConformantTypeArguments(LightweightTypeReference left, LightweightTypeReference right, int flags)
RawTypeConformanceComputerTypeConformanceComputer to implement the type argument check.doIsConformantTypeArguments in class RawTypeConformanceComputerprotected int doIsConformantOuterType(LightweightTypeReference left, LightweightTypeReference right, int flags)
protected int doIsConformant(FunctionTypeReference left, FunctionTypeReference right, int flags)
doIsConformant in class RawTypeConformanceComputerpublic LightweightTypeReference getCommonSuperType(java.util.List<LightweightTypeReference> types, ITypeReferenceOwner owner)
null in case one of the types is primitive void but not all
of them are.protected boolean isClass(org.eclipse.xtext.common.types.JvmType type)
protected void initializeDistance(LightweightTypeReference firstType, com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all, com.google.common.collect.Multiset<org.eclipse.xtext.common.types.JvmType> cumulatedDistance)
protected void cumulateDistance(java.util.List<LightweightTypeReference> references, com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all, com.google.common.collect.Multiset<org.eclipse.xtext.common.types.JvmType> cumulatedDistance)
protected void inplaceSortByDistanceAndName(java.util.List<com.google.common.collect.Multiset.Entry<org.eclipse.xtext.common.types.JvmType>> candidates)
protected java.util.List<LightweightTypeReference> replacePrimitivesAndRemoveAnyReferences(java.util.List<LightweightTypeReference> types)
protected boolean containsPrimitiveOrAnyReferences(java.util.List<LightweightTypeReference> types)
protected LightweightTypeReference getFirstForRawType(com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all, org.eclipse.xtext.common.types.JvmType rawType)
protected LightweightTypeReference getTypeParametersForSupertype(com.google.common.collect.Multimap<org.eclipse.xtext.common.types.JvmType,LightweightTypeReference> all, org.eclipse.xtext.common.types.JvmType rawType, ITypeReferenceOwner owner, java.util.List<LightweightTypeReference> initiallyRequested)
protected boolean enhanceSuperType(java.util.List<LightweightTypeReference> superTypes, java.util.List<LightweightTypeReference> initiallyRequested, ParameterizedTypeReference result)
public LightweightTypeReference getCommonParameterSuperType(java.util.List<LightweightTypeReference> types, java.util.List<LightweightTypeReference> initiallyRequested, ITypeReferenceOwner owner)
protected boolean isRecursiveRequest(java.util.List<LightweightTypeReference> types, java.util.Set<java.lang.String> allNames, java.util.List<LightweightTypeReference> initiallyRequested)
public LightweightTypeReference getMostSpecialType(java.util.List<LightweightTypeReference> candidates)
protected void addComponentType(LightweightTypeReference reference, java.util.List<LightweightTypeReference> result)
protected LightweightTypeReference conformsToAll(LightweightTypeReference type, java.util.List<LightweightTypeReference> types)