public abstract class ParameterTypeInferencePolicy
extends java.lang.Object
Constructor and Description |
---|
ParameterTypeInferencePolicy() |
Modifier and Type | Method and Description |
---|---|
abstract PsiType |
adjustInferredType(PsiManager manager,
PsiType guess,
ConstraintType second) |
abstract PsiType |
getDefaultExpectedType(PsiCallExpression methodCall) |
abstract Pair<PsiType,ConstraintType> |
getInferredTypeWithNoConstraint(PsiManager manager,
PsiType superType) |
boolean |
inferLowerBoundForFreshVariables()
For infinite type declarations, like
Foo<T extends Foo<T>> , inference introduces fake fresh "fixed" type parameters. |
boolean |
inferRuntimeExceptionForThrownBoundWithNoConstraints() |
abstract Pair<PsiType,ConstraintType> |
inferTypeConstraintFromCallContext(PsiExpression innerMethodCall,
PsiExpressionList parent,
PsiCallExpression contextCall,
PsiTypeParameter typeParameter) |
boolean |
isVarargsIgnored() |
boolean |
requestForBoxingExplicitly()
Workaround for inference < 1.8.
|
public abstract Pair<PsiType,ConstraintType> inferTypeConstraintFromCallContext(PsiExpression innerMethodCall, PsiExpressionList parent, PsiCallExpression contextCall, PsiTypeParameter typeParameter)
public abstract PsiType getDefaultExpectedType(PsiCallExpression methodCall)
public abstract Pair<PsiType,ConstraintType> getInferredTypeWithNoConstraint(PsiManager manager, PsiType superType)
public boolean inferRuntimeExceptionForThrownBoundWithNoConstraints()
public abstract PsiType adjustInferredType(PsiManager manager, PsiType guess, ConstraintType second)
public boolean isVarargsIgnored()
public boolean inferLowerBoundForFreshVariables()
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.public boolean requestForBoxingExplicitly()
JavaMethodCallElement.setInferenceSubstitutorFromExpectedType(com.intellij.psi.PsiElement, com.intellij.psi.PsiType)
,
but should not be used for normal inference due to javac bug