Class TypeHelper
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typeinference.TypeHelper
The term "type" is used loosely in this chapter to include type-like syntax that contains inference variables.
Assertions that involve inference
variables are assertions about every proper type that can be produced by replacing each inference variable with
a proper type.
- Author:
- Federico Tomassetti
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
static MethodType
getFunctionType(ResolvedType type)
static ResolvedType
glb(Set<ResolvedType> types)
See JLS 5.1.10.static Pair<ResolvedType,Boolean>
groundTargetTypeOfLambda(LambdaExpr lambdaExpr, ResolvedType T, TypeSolver typeSolver)
See JLS 15.27.3.static boolean
see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3static boolean
isCompatibleInALooseInvocationContext(TypeSolver typeSolver, Expression expression, ResolvedType t)
see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3static boolean
isCompatibleInAStrictInvocationContext(Expression expression, ResolvedType t)
see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3static boolean
isProperType(ResolvedType type)
The term proper type excludes such "types" that mention inference variables.static ResolvedType
leastUpperBound(Set<ResolvedType> types)
See JLS 4.10.4.static ResolvedType
toBoxedType(ResolvedPrimitiveType primitiveType)
static ResolvedType
toBoxedType(ResolvedPrimitiveType primitiveType, TypeSolver typeSolver)
static Set<InferenceVariable>
-
Constructor Details
-
TypeHelper
public TypeHelper()
-
-
Method Details
-
isProperType
The term proper type excludes such "types" that mention inference variables. -
isCompatibleInAStrictInvocationContext
public static boolean isCompatibleInAStrictInvocationContext(Expression expression, ResolvedType t)see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3- Parameters:
expression
-t
-- Returns:
-
isCompatibleInALooseInvocationContext
public static boolean isCompatibleInALooseInvocationContext(TypeSolver typeSolver, Expression expression, ResolvedType t)see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3- Parameters:
expression
-t
-- Returns:
-
isCompatibleInALooseInvocationContext
see https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.3- Parameters:
s
-t
-- Returns:
-
toBoxedType
-
toBoxedType
-
areCompatibleThroughWideningReferenceConversion
public static boolean areCompatibleThroughWideningReferenceConversion(ResolvedType s, ResolvedType t) -
areCompatibleThroughWideningPrimitiveConversion
public static boolean areCompatibleThroughWideningPrimitiveConversion(ResolvedType s, ResolvedType t) -
usedInferenceVariables
-
leastUpperBound
See JLS 4.10.4. Least Upper Bound. -
groundTargetTypeOfLambda
public static Pair<ResolvedType,Boolean> groundTargetTypeOfLambda(LambdaExpr lambdaExpr, ResolvedType T, TypeSolver typeSolver)See JLS 15.27.3. Type of a Lambda Expression- Returns:
-
getFunctionType
-
glb
See JLS 5.1.10. Capture Conversion.
-