Class ClosureWithoutExpectationHelper
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.computation.AbstractClosureTypeHelper
-
- org.eclipse.xtext.xbase.typesystem.computation.ClosureWithoutExpectationHelper
-
- All Implemented Interfaces:
IApplicableCandidate,IClosureCandidate
public class ClosureWithoutExpectationHelper extends AbstractClosureTypeHelper
Strategy to compute types for lambda expression that do not have an expected type or that have an expected type which is not a SAM type. The type of the lamdba's body expression is computed without any constraints. After the fact it is used to determine whether the lambda is a procedure or a function.- See Also:
ClosureWithExpectationHelper- Noinstantiate:
- This class is not intended to be instantiated by clients.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedClosureWithoutExpectationHelper(XClosure closure, ITypeExpectation expectation, ITypeComputationState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ITypeComputationStateassignParameters(ITypeAssigner typeAssigner, FunctionTypeReference incompleteClosureType)protected voidcomputeTypes()protected ITypeComputationStategetClosureBodyTypeComputationState(ITypeAssigner typeAssigner, FunctionTypeReference incompleteClosureType)FunctionTypeReferencegetExpectedClosureType()This method is only public for testing purpose.protected FunctionTypeReferencegetFunctionTypeReference(boolean isProcedure)org.eclipse.xtext.common.types.JvmOperationgetOperation()This method is only public for testing purpose.java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter>getParameters()Returns the effective list of parameters.protected voidinitClosureType(FunctionTypeReference result, boolean isProcedure)protected FunctionTypeReferenceprocessExpressionType(FunctionTypeReference incompleteClosureType, ITypeComputationResult expressionResult)-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.computation.AbstractClosureTypeHelper
applyToModel, deferredBindTypeArgument, getClosure, getExpectation, getServices, getState, validate
-
-
-
-
Constructor Detail
-
ClosureWithoutExpectationHelper
protected ClosureWithoutExpectationHelper(XClosure closure, ITypeExpectation expectation, ITypeComputationState state)
-
-
Method Detail
-
computeTypes
protected void computeTypes()
- Specified by:
computeTypesin classAbstractClosureTypeHelper
-
getExpectedClosureType
public FunctionTypeReference getExpectedClosureType()
Description copied from class:AbstractClosureTypeHelperThis method is only public for testing purpose.- Specified by:
getExpectedClosureTypein classAbstractClosureTypeHelper
-
getOperation
public org.eclipse.xtext.common.types.JvmOperation getOperation()
Description copied from class:AbstractClosureTypeHelperThis method is only public for testing purpose.- Specified by:
getOperationin classAbstractClosureTypeHelper
-
getFunctionTypeReference
protected FunctionTypeReference getFunctionTypeReference(boolean isProcedure)
- Noreference:
- This method is not intended to be referenced by clients.
-
initClosureType
protected void initClosureType(FunctionTypeReference result, boolean isProcedure)
-
getClosureBodyTypeComputationState
protected ITypeComputationState getClosureBodyTypeComputationState(ITypeAssigner typeAssigner, FunctionTypeReference incompleteClosureType)
-
getParameters
public java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter> getParameters()
Description copied from interface:IClosureCandidateReturns the effective list of parameters. This may either be the declared parameter list or the synthetic parameter list.- Specified by:
getParametersin interfaceIClosureCandidate- Specified by:
getParametersin classAbstractClosureTypeHelper
-
assignParameters
protected ITypeComputationState assignParameters(ITypeAssigner typeAssigner, FunctionTypeReference incompleteClosureType)
-
processExpressionType
protected FunctionTypeReference processExpressionType(FunctionTypeReference incompleteClosureType, ITypeComputationResult expressionResult)
-
-