Class InferenceResult
java.lang.Object
de.monticore.types3.generics.context.InferenceResult
Internal results of inference.
This one stores information to be passed 'upwards' in the AST.
This is done as, depending on the expression,
multiple passes can be required.
It is used until a compile-time type (a type without free type variables)
can be calculated and stored in
Type4Ast.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Optional<List<ExpressionCompatibilityConstraint>> protected booleanA type-check error occurred (and has been logged).protected Optional<InferenceVisitorMode> protected Optional<SymTypeOfFunction> protected Optional<SymTypeExpression> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetB0()Function parameter bounds s.getB2()Function applicability bounds s.getB3()Function invocation compatibility bounds s.getB4()Function invocation type bounds s.getB4C()Function invocation type constraints used to get function invocation type bounds s.Gets the compile-time type.A function, either required by an invocation, or by assignment, e.g.,(a?b:c)(1)// here, b and c are required to be functions(int) -> void f = a;// here, a is required to be a function Only call ifhasResolvedFunction()returns true.protected Optional<SymTypeOfFunction> getResolvedFunction(List<Bound> bounds) During many checks (s.Can be a function, but in the context, no function was required.booleanbooleanbooleanvoidvoidvoidvoidvoidvoidvoidvoidsetResolvedFunction(SymTypeOfFunction resolvedFunction) voidsetResolvedNonInvocationType(SymTypeExpression resolvedNonInvocationType)
-
Field Details
-
lastMode
-
hasErrorOccurred
protected boolean hasErrorOccurredA type-check error occurred (and has been logged). Stop the inference process. -
resolvedFunction
-
resolvedNonInvocationType
-
b0
-
b2
-
b3
-
b4C
-
b4
-
-
Constructor Details
-
InferenceResult
public InferenceResult()
-
-
Method Details
-
getLastInferenceMode
- Returns:
- the last mode used to collect information
-
setLastInferenceMode
-
hasErrorOccurred
public boolean hasErrorOccurred() -
setHasErrorOccurred
public void setHasErrorOccurred() -
hasResolvedFunction
public boolean hasResolvedFunction() -
hasResolvedNonInvocationType
public boolean hasResolvedNonInvocationType() -
getResolvedFunction
A function, either required by an invocation, or by assignment, e.g.,(a?b:c)(1)// here, b and c are required to be functions(int) -> void f = a;// here, a is required to be a function Only call ifhasResolvedFunction()returns true. -
setResolvedFunction
-
getResolvedNonInvocationType
Can be a function, but in the context, no function was required. There are no bounds and the type cannot have inference vars. Only call ifhasResolvedFunction()returns false. -
setResolvedNonInvocationType
-
getB0
Function parameter bounds s. JLS 21 18.1.3 B0 -
setB0
-
getB2
Function applicability bounds s. JLS 21 18.5.1 B2 -
setB2
-
getApplicabilityInstantiation
-
getB3
Function invocation compatibility bounds s. JLS 21 18.5.2.1 B3 -
setB3
-
getInvocationCompatibilityInstantiation
-
getB4C
Function invocation type constraints used to get function invocation type bounds s. JLS 21 18.5.2.2 C -
setB4C
-
getB4
Function invocation type bounds s. JLS 21 18.5.2.2 B4 -
setB4
-
getInvocationType
-
getCompileTimeType
Gets the compile-time type. This is either thegetInvocationType()orgetResolvedNonInvocationType(). -
getResolvedFunction
During many checks (s. InferenceVisitorMode), it is required to check whether resolution of a set of bounds succeeds. In Addition to this information, the corresponding instantiation of the function is returned on success.
-