public class CompletionParameterTypeInferencePolicy extends ProcessCandidateParameterTypeInferencePolicy
Modifier and Type | Field and Description |
---|---|
static CompletionParameterTypeInferencePolicy |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
PsiType |
adjustInferredType(PsiManager manager,
PsiType guess,
ConstraintType constraintType) |
PsiType |
getDefaultExpectedType(PsiCallExpression methodCall) |
Pair<PsiType,ConstraintType> |
getInferredTypeWithNoConstraint(PsiManager psiManager,
PsiType superType) |
boolean |
inferLowerBoundForFreshVariables()
For infinite type declarations, like
Foo<T extends Foo<T>> , inference introduces fake fresh "fixed" type parameters. |
boolean |
inferRuntimeExceptionForThrownBoundWithNoConstraints() |
boolean |
isVarargsIgnored() |
boolean |
requestForBoxingExplicitly()
Workaround for inference < 1.8.
|
getExpressions, getResults, getSubstitutor, inferConstraint, inferTypeConstraintFromCallContext
public static final CompletionParameterTypeInferencePolicy INSTANCE
public PsiType getDefaultExpectedType(PsiCallExpression methodCall)
getDefaultExpectedType
in class DefaultParameterTypeInferencePolicy
public Pair<PsiType,ConstraintType> getInferredTypeWithNoConstraint(PsiManager psiManager, PsiType superType)
getInferredTypeWithNoConstraint
in class DefaultParameterTypeInferencePolicy
public boolean inferRuntimeExceptionForThrownBoundWithNoConstraints()
inferRuntimeExceptionForThrownBoundWithNoConstraints
in class ParameterTypeInferencePolicy
public PsiType adjustInferredType(PsiManager manager, PsiType guess, ConstraintType constraintType)
adjustInferredType
in class DefaultParameterTypeInferencePolicy
public boolean isVarargsIgnored()
isVarargsIgnored
in class ParameterTypeInferencePolicy
public boolean inferLowerBoundForFreshVariables()
ParameterTypeInferencePolicy
Foo<T extends Foo<T>>
, inference introduces fake fresh "fixed" type parameters.
These fresh parameters respect constraints, created during inference session. For completion, it makes sense to define lower bounds
even if no appropriate constraints were detected, as probably the corresponding argument is currently completed.inferLowerBoundForFreshVariables
in class ParameterTypeInferencePolicy
public boolean requestForBoxingExplicitly()
ParameterTypeInferencePolicy
JavaMethodCallElement.setInferenceSubstitutorFromExpectedType(com.intellij.psi.PsiElement, com.intellij.psi.PsiType)
,
but should not be used for normal inference due to javac bugrequestForBoxingExplicitly
in class ParameterTypeInferencePolicy