public class TypeDefinition extends TypeTermScheme
An object of this class consists of a (type) name, possibly along with some type parameters if it is polymorphic, and associated with a type defining it. Such type definitions are not opaque: the type terms are fully expanded into the definition they stand for and disappear altogether once this is done. In other words, using a this construct is paramount to using a shorthand notation; importantly, it does not create a new type. Thus, its purpose is simply to offer a syntactic convenience that may be used to enhance program legibility. Once defined with an object of this class, a type term with this name (possibly with type arguments if this definition is polymorphic) can be used anywhere a type is expected.
If what is sought is an opaque type definition, then what is needed is a DefinedType.
At any rate, look in Tables for the methods that will define a type alias (DefineTypeAlias(...)) or a new opaque type (DefineNewType(...)).
DefinedType,
Tables| Modifier and Type | Method and Description |
|---|---|
Type |
definition()
Returns a fresh copy of the type defining this definition's type term.
|
Type |
instantiate(java.util.AbstractList types)
Returns a fresh copy of the type definition instantiated with the specified types.
|
java.lang.String |
toString() |
arity, parameterspublic final Type definition()
public final Type instantiate(java.util.AbstractList types) throws StaticSemanticsErrorException
StaticSemanticsErrorExceptionpublic final java.lang.String toString()
toString in class java.lang.Object