orc.type
Class TypeInstance

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

public class TypeInstance
extends Type

A type constructor instantiated at particular types, e.g. a List of Integers. The type params may be empty in the special case that a type instance is constructed and substituted by the compiler itself, for example when binding a declared Java class with no generic parameters in Orc type space. At present, users should not be able to write types using type applications to an empty parameter list.

Author:
dkitchin

Field Summary
 java.util.List<Type> params
           
 Tycon tycon
           
 
Fields inherited from class orc.type.Type
BOOLEAN, BOT, INTEGER, LET, NUMBER, SIGNAL, STRING, TOP
 
Constructor Summary
TypeInstance(Tycon tycon, java.util.List<Type> params)
           
 
Method Summary
 void addConstraints(Env<java.lang.Boolean> VX, Type T, Constraint[] C)
           
 Type call(java.util.List<Type> args)
           
 Type call(TypingContext ctx, java.util.List<Argument> args, java.util.List<Type> typeActuals)
           
 Type demote(Env<java.lang.Boolean> V)
           
 Variance findVariance(java.lang.Integer var)
           
 java.util.Set<java.lang.Integer> freeVars()
           
 java.lang.Class javaCounterpart()
          Determine whether this type has a counterpart as a non-generic class in the Java class hierarchy.
 Type join(Type that)
           
 Type meet(Type that)
           
 Type promote(Env<java.lang.Boolean> V)
           
 Type subst(Env<Type> ctx)
           
 boolean subtype(Type that)
           
 java.lang.String toString()
           
 Type unwrapAs(Type T)
           
 
Methods inherited from class orc.type.Type
allFreeVars, assertSubtype, asTycon, closed, equal, fromJavaClass, fromJavaMethod, fromJavaMethods, fromJavaType, fromJavaType, isBot, isTop, makeJavaCtx, makeJavaCtx, marshal, resolveSites, shiftFreeVars, substAll, supertype, variances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tycon

public Tycon tycon

params

public java.util.List<Type> params
Constructor Detail

TypeInstance

public TypeInstance(Tycon tycon,
                    java.util.List<Type> params)
Method Detail

subtype

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

join

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

meet

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

call

public Type call(TypingContext ctx,
                 java.util.List<Argument> args,
                 java.util.List<Type> typeActuals)
          throws TypeException
Overrides:
call in class Type
Throws:
TypeException

call

public Type call(java.util.List<Type> args)
          throws TypeException
Overrides:
call in class Type
Throws:
TypeException

subst

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

findVariance

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

promote

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

demote

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

addConstraints

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

unwrapAs

public Type unwrapAs(Type T)
              throws TypeException
Overrides:
unwrapAs in class Type
Throws:
TypeException

javaCounterpart

public java.lang.Class javaCounterpart()
Description copied from class: Type
Determine whether this type has a counterpart as a non-generic class in the Java class hierarchy. If not, return null. This is not a true inverse of fromJavaClass, though it behaves like one in most cases.

Overrides:
javaCounterpart in class Type

freeVars

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

toString

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