|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.comp.Infer
public class Infer
Helper class for type parameter inference, used by the attribution phase.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Nested Class Summary | |
|---|---|
static class |
Infer.NoInstanceException
|
| Field Summary | |
|---|---|
private Infer.NoInstanceException |
ambiguousNoInstanceException
|
static Type |
anyPoly
A value for prototypes that admit any type, including polymorphic ones. |
(package private) JCDiagnostic.Factory |
diags
|
(package private) Type.Mapping |
fromTypeVarFun
A mapping that turns type variables into undetermined type variables. |
(package private) Type.Mapping |
getInstFun
A mapping that returns its type argument with every UndetVar replaced by its `inst' field. |
protected static Context.Key<Infer> |
inferKey
|
(package private) Symtab |
syms
|
(package private) Types |
types
|
private Infer.NoInstanceException |
unambiguousNoInstanceException
|
| Constructor Summary | |
|---|---|
protected |
Infer(Context context)
|
| Method Summary | |
|---|---|
private void |
checkWithinBounds(List<Type> tvars,
List<Type> arguments,
Warner warn)
check that type parameters are within their bounds. |
static Infer |
instance(Context context)
|
private Type |
instantiateArg(Type.ForAll that,
Type to,
List<Type> tvars,
Warner warn)
Try to instantiate argument type `that' to given type `to'. |
Type |
instantiateExpr(Type.ForAll that,
Type to,
Warner warn)
Try to instantiate expression type `that' to given type `to'. |
Type |
instantiateMethod(List<Type> tvars,
Type.MethodType mt,
List<Type> argtypes,
boolean allowBoxing,
boolean useVarargs,
Warner warn)
Instantiate method type `mt' by finding instantiations of `tvars' so that method can be applied to `argtypes'. |
private boolean |
isSubClass(Type t,
List<Type> ts)
|
(package private) void |
maximizeInst(Type.UndetVar that,
Warner warn)
Instantiate undetermined type variable to its minimal upper bound. |
(package private) void |
minimizeInst(Type.UndetVar that,
Warner warn)
Instantiate undetermined type variable to the lub of all its lower bounds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Context.Key<Infer> inferKey
public static final Type anyPoly
Symtab syms
Types types
JCDiagnostic.Factory diags
private final Infer.NoInstanceException ambiguousNoInstanceException
private final Infer.NoInstanceException unambiguousNoInstanceException
Type.Mapping fromTypeVarFun
Type.Mapping getInstFun
| Constructor Detail |
|---|
protected Infer(Context context)
| Method Detail |
|---|
public static Infer instance(Context context)
void maximizeInst(Type.UndetVar that,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
private boolean isSubClass(Type t,
List<Type> ts)
void minimizeInst(Type.UndetVar that,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
public Type instantiateExpr(Type.ForAll that,
Type to,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
public Type instantiateMethod(List<Type> tvars,
Type.MethodType mt,
List<Type> argtypes,
boolean allowBoxing,
boolean useVarargs,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
private Type instantiateArg(Type.ForAll that,
Type to,
List<Type> tvars,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
private void checkWithinBounds(List<Type> tvars,
List<Type> arguments,
Warner warn)
throws Infer.NoInstanceException
Infer.NoInstanceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||