orc.type
Class TypeVariable

java.lang.Object
  extended by orc.type.Type
      extended by orc.type.TypeVariable

public class TypeVariable
extends Type

A bound type variable. Subtype comparisons may occur between types with bound variables (such as between the type bodies of parameterized arrow types), so there is a subtype relation specified for type variables: it is simply variable equality.

Author:
dkitchin

Field Summary
 int index
           
 java.lang.String name
           
 
Fields inherited from class orc.type.Type
BOOLEAN, BOT, INTEGER, LET, NUMBER, SIGNAL, STRING, TOP
 
Constructor Summary
TypeVariable(int index)
           
TypeVariable(int index, java.lang.String name)
           
 
Method Summary
 void addConstraints(Env<java.lang.Boolean> VX, Type T, Constraint[] C)
           
 Type demote(Env<java.lang.Boolean> V)
           
 Variance findVariance(java.lang.Integer var)
           
 java.util.Set<java.lang.Integer> freeVars()
           
 Type marshal()
          Convert to a syntactic type.
 Type promote(Env<java.lang.Boolean> V)
           
 Type subst(Env<Type> ctx)
           
 boolean subtype(Type that)
           
 java.lang.String toString()
           
 
Methods inherited from class orc.type.Type
allFreeVars, assertSubtype, asTycon, call, call, closed, equal, fromJavaClass, fromJavaMethod, fromJavaMethods, fromJavaType, fromJavaType, isBot, isTop, javaCounterpart, join, makeJavaCtx, makeJavaCtx, meet, resolveSites, shiftFreeVars, substAll, supertype, unwrapAs, variances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

index

public int index

name

public java.lang.String name
Constructor Detail

TypeVariable

public TypeVariable(int index)

TypeVariable

public TypeVariable(int index,
                    java.lang.String name)
Method Detail

subtype

public boolean subtype(Type that)
                throws TypeException
Overrides:
subtype in class Type
Throws:
TypeException

subst

public Type subst(Env<Type> ctx)
Overrides:
subst in class Type

findVariance

public Variance findVariance(java.lang.Integer var)
Overrides:
findVariance in class Type

promote

public Type promote(Env<java.lang.Boolean> V)
Overrides:
promote in class Type

demote

public Type demote(Env<java.lang.Boolean> V)
Overrides:
demote in class Type

addConstraints

public void addConstraints(Env<java.lang.Boolean> VX,
                           Type T,
                           Constraint[] C)
                    throws TypeException
Overrides:
addConstraints in class Type
Throws:
TypeException

toString

public java.lang.String toString()
Overrides:
toString in class Type

marshal

public Type marshal()
             throws UnrepresentableTypeException
Description copied from class: Type
Convert to a syntactic type. May return null if the type is not representable.

Overrides:
marshal in class Type
Returns:
The syntactic type corresponding to this type
Throws:
UnrepresentableTypeException

freeVars

public java.util.Set<java.lang.Integer> freeVars()
Overrides:
freeVars in class Type