public interface Type
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Type.Array
An array type describes array values whose elements are subtypes of the
element type.
|
static interface |
Type.EffectiveArray
An effective array is a type which looks like an array, but is not
exactly an array.
|
static interface |
Type.EffectiveRecord
An effective record is a type which looks like a record, but is not
exactly a record.
|
static interface |
Type.EffectiveReference
An effective reference is a type which looks like an reference, but is
not exactly an reference.
|
static interface |
Type.Function
Represents the set of all function values.
|
static interface |
Type.FunctionOrMethod
Represents the set of all functions or methods.
|
static class |
Type.Impl |
static interface |
Type.Intersection
Represents the intersection of one or more types together.
|
static interface |
Type.Leaf
Represents a type which constitutes a "leaf" node in the type tree.
|
static interface |
Type.Method
Represents the set of all method values.
|
static interface |
Type.Negation
Represents the set of types which are not in a given type.
|
static interface |
Type.Nominal
Represents a named type within the system.
|
static interface |
Type.Primitive
Represents a primitive type (e.g.
|
static interface |
Type.Property
Represents the set of all proeprty values.
|
static interface |
Type.Record
A record is made up of a number of fields, each of which has a unique
name.
|
static interface |
Type.Reference
Represents a reference to an object in Whiley.
|
static interface |
Type.Union
Represents the union of one or more types together.
|
| Modifier and Type | Field and Description |
|---|---|
static Type |
T_ANY
The type any represents the type whose variables may hold any possible
value.
|
static Type |
T_BOOL
Represents the set of boolean values (i.e.
|
static Type |
T_BYTE
Represents a sequence of 8 bits.
|
static Type |
T_INT
Represents the set of (unbound) integer values.
|
static Type |
T_META
The type meta represents the type of types.
|
static Type |
T_NULL
The null type is a special type which should be used to show the absence
of something.
|
static Type |
T_VOID
A void type represents the type whose variables cannot exist! That is,
they cannot hold any possible value.
|
| Modifier and Type | Method and Description |
|---|---|
static Type |
Array(Type element) |
static Type |
fromString(String str) |
static Type |
Function(Type[] parameters,
Type[] returns) |
static Type |
Intersection(Type... types)
Construct the intersection of one or more types together.
|
static Type |
Method(Collection<String> lifetimeParameters,
Collection<String> contextLifetimes,
Type[] parameters,
Type[] returns) |
static Type |
Method(String[] lifetimeParameters,
String[] contextLifetimes,
Type[] parameters,
Type[] returns) |
static Type |
Method(Type[] parameters,
Type[] returns) |
static Type |
Negation(Type type)
Construct the negation of a given type.
|
static Type |
Nominal(wybs.lang.NameID name) |
static Type |
Property(Type[] parameters) |
static Type |
Record(boolean isOpen,
List<wycc.util.Pair<Type,String>> fields) |
static Type |
Record(boolean isOpen,
wycc.util.Pair<Type,String>... fields) |
static Type |
Reference(String lifetime,
Type element) |
static wyil.lang.Type.Impl.Array[] |
toImplArrays(Type.Impl[] types) |
static Type.Impl[] |
toImplOrVoid(Type[] types) |
static wyil.lang.Type.Impl.Record[] |
toImplRecords(Type.Impl[] types) |
static Type |
Union(Type... types)
Construct the union of one or more types together.
|
static final Type T_ANY
static final Type T_VOID
static final Type T_NULL
null value (where as there is no special "void"
value). With all of the problems surrounding null and
NullPointerExceptions in languages like Java and C, it may
seem that this type should be avoided. However, it remains a very useful
abstraction to have around and, in Whiley, it is treated in a completely
safe manner (unlike e.g. Java).static final Type T_BOOL
static final Type T_BYTE
Byte.toInt()).static final Type T_INT
MIN_VALUE and MAX_VALUE for int
types.static final Type T_META
class Class {}).static Type Nominal(wybs.lang.NameID name)
static Type Method(Collection<String> lifetimeParameters, Collection<String> contextLifetimes, Type[] parameters, Type[] returns)
static Type Method(String[] lifetimeParameters, String[] contextLifetimes, Type[] parameters, Type[] returns)
static wyil.lang.Type.Impl.Array[] toImplArrays(Type.Impl[] types)
static wyil.lang.Type.Impl.Record[] toImplRecords(Type.Impl[] types)
static Type Negation(Type type)
types - static Type Union(Type... types)
types - static Type Intersection(Type... types)
types - Copyright © 2017. All rights reserved.