ttype

The types of ASR.

Declaration

Syntax

ttype
    = Integer(int kind)
    | UnsignedInteger(int kind)
    | Real(int kind)
    | Complex(int kind)
    | String(int kind, expr? len, string_length_kind len_kind, string_physical_type physical_type)
    | Logical(int kind)
    | Set(ttype type)
    | List(ttype type)
    | Tuple(ttype* type)
    | StructType(ttype* data_member_types, ttype* member_function_types, bool is_cstruct, bool is_unlimited_polymorphic)
    | EnumType(symbol enum_type)
    | UnionType(ttype* data_member_types)
    | Dict(ttype key_type, ttype value_type)
    | Pointer(ttype type)
    | Allocatable(ttype type)
    | CPtr()
    | SymbolicExpression()
    | TypeParameter(identifier param)
    | Array(ttype type, dimension* dims, array_physical_type physical_type)
    | FunctionType(ttype* arg_types, ttype? return_var_type, abi abi, deftype deftype, string? bindc_name, bool elemental, bool pure, bool module, bool inline, bool static, symbol* restrictions, bool is_restriction)

Arguments

None.

Return values

None. A type is not evaluated.

Description

A ttype describes what a value is: the type of every expression, of every variable and of every procedure argument is one of these.

The types divide into a few groups:

A type separates what a value is from how it is represented. An Array carries an array_physical_type and a String a string_physical_type, and two values with the same logical type may differ in it; the physical casts, ArrayPhysicalCast and StringPhysicalCast, convert between representations without changing the value, while Cast changes the value itself.

See Also

kinds, Cast, symbol

Type Nodes