CType is a "compiler type" which is class used for representing the Fan type system in the compiler. CTypes map to types within the compilation units themsevles as TypeDef and TypeRef or to precompiled types in imported pods via ReflectType or FType.
Slots
- base
-
abstract CType base()
The direct super class of this type (null for Obj).
- common
-
static const CType common(Namespace ns, CType[] types)
Given a list of types, compute the most specific type which they all share, or at worst return sys::Obj. This method does not take into account mixins, only extends class inheritance.
- ctors
-
CMethod[] ctors()
List of the all constructors.
- deref
-
virtual CType deref()
If this is a TypeRef, return what it references
- equals
-
Equality based on signature.
- field
-
Lookup a field by name.
- fields
-
CField[] fields()
List of the all defined fields (including inherited fields).
- fits
-
Does this type implement the specified type. If true, then this type is assignable to the specified type (although the converse is not necessarily true). All types (including mixin types) fit sys::Obj.
- fitsAny
-
Return if this type fits any of the types in the specified list.
- flags
-
abstract Int flags()
Get the flags bitmask.
- hasSlot
-
Return if this type contains a slot by the specified name.
- hash
-
virtual Int hash()
Hash on signature.
- isAbstract
-
Bool isAbstract()
Return if this Type is abstract and cannot be instantiated. This method will always return true if the type is a mixin.
- isBool
-
Bool isBool()
- isClass
-
Bool isClass()
Return if this Type is a class (as opposed to enum or mixin)
- isConst
-
Bool isConst()
Return if this Type is const and immutable.
- isEnum
-
Bool isEnum()
Return if this Type is an sys::Enum
- isFinal
-
Bool isFinal()
Return if this Type is final and cannot be subclassed.
- isFloat
-
Bool isFloat()
- isGeneric
-
abstract Bool isGeneric()
A generic type means that one or more of my slots contain signatures using a generic parameter (such as V or K). Fan supports three built-in generic types: List, Map, and Func. A generic instance (such as Str[]) is NOT a generic type (all of its generic parameters have been filled in). User defined generic types are not supported in Fan.
- isGenericParameter
-
abstract Bool isGenericParameter()
Return if this type is a generic parameter (such as V or K) in a generic type (List, Map, or Method). Generic parameters serve as place holders for the parameterization of the generic type. Fan has a predefined set of generic parameters which are always defined in the sys pod with a one character name.
- isInt
-
Bool isInt()
- isInternal
-
Bool isInternal()
Is this an internally scoped class
- isMixin
-
Bool isMixin()
Return if this Type is a mixin type and cannot be instantiated.
- isObj
-
Bool isObj()
- isParameterized
-
abstract Bool isParameterized()
A parameterized type is a type which has parameterized a generic type and replaced all the generic parameter types with generic argument types. The type Str[] is a parameterized type of the generic type List (V is replaced with Str). A parameterized type always has a signature which is different from the qname.
- isPublic
-
Bool isPublic()
Is this a public scoped class
- isRange
-
Bool isRange()
- isStr
-
Bool isStr()
- isSynthetic
-
Bool isSynthetic()
Is this a compiler generated synthetic class
- isType
-
Bool isType()
- isVoid
-
Bool isVoid()
- method
-
Lookup a method by name.
- methods
-
CMethod[] methods()
List of the all defined methods (including inherited methods).
- mixins
-
abstract CType[] mixins()
Return the mixins directly implemented by this type.
- name
-
abstract Str name()
Simple name of the type such as "Str".
- ns
-
abstract Namespace ns()
Associated namespace for this type representation
- pod
-
abstract CPod pod()
Parent pod which defines this type.
- qname
-
abstract Str qname()
Qualified name such as "sys:Str".
- raw
-
CType raw()
If this type is a generic parameter (V, L, etc), then return the actual type for the native implementation. For example V is Obj, and L is List. This is the type we actually use when constructing a signature for the invoke opcode.
- signature
-
abstract Str signature()
This is the full signature of the type.
- slot
-
Lookup a slot by name. If the slot doesn't exist then return null.
- slots
-
abstract Str:CSlot slots()
Map of the all defined slots, both fields and methods (including inherited slots).
- toListOf
-
abstract ListType toListOf()
Create a parameterized List of this type.
More Info
Slots
- base
- common
- ctors
- deref
- equals
- field
- fields
- fits
- fitsAny
- flags
- hasSlot
- hash
- isAbstract
- isBool
- isClass
- isConst
- isEnum
- isFinal
- isFloat
- isGeneric
- isGenericParameter
- isInt
- isInternal
- isMixin
- isObj
- isParameterized
- isPublic
- isRange
- isStr
- isSynthetic
- isType
- isVoid
- method
- methods
- mixins
- name
- ns
- pod
- qname
- raw
- signature
- slot
- slots
- toListOf