sun::types::Types

sun::types::Types

class · Source (opens in a new tab)

class sun::types::Types

Type factory for common types (singleton pattern).

Public Functions

Array

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Array(TypePtr elementType, std::vector< size_t > dimensions)

Create a fixed-size array type: array<T, N> or array<T, M, N>.

Related: TypePtr

Bool

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Bool()

Returns the shared semantic type descriptor for Sun bool values.

Related: TypePtr

Char

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Char()

Returns the shared semantic type descriptor for Sun char values.

Related: TypePtr

Float32

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Float32()

Returns the shared semantic type descriptor for Sun float32 values.

Related: TypePtr

Float64

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Float64()

Returns the shared semantic type descriptor for Sun float64 values.

Related: TypePtr

Function

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Function(TypePtr returnType, std::vector< TypePtr > paramTypes, bool canThrow=false, bool requiresUnsafe=false)

Create a function-pointer type: function () T.

Related: TypePtr

Int16

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Int16()

Returns the shared semantic type descriptor for Sun int16 values.

Related: TypePtr

Int32

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Int32()

Returns the shared semantic type descriptor for Sun int32 values.

Related: TypePtr

Int64

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Int64()

Returns the shared semantic type descriptor for Sun int64 values.

Related: TypePtr

Int8

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Int8()

Returns the shared semantic type descriptor for Sun int8 values.

Related: TypePtr

Lambda

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Lambda(TypePtr returnType, std::vector< TypePtr > paramTypes, bool canThrow=false, bool requiresUnsafe=false)

Create a lambda type: () => {} (anonymous function, fat pointer call).

Related: TypePtr

Module

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Module(const std::string &modulePath)

Module reference type for qualified name resolution (mod_x.mod_y.var).

Related: TypePtr

NullPointer

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::NullPointer()

Create a null pointer type (singleton).

Related: TypePtr

RawPointer

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::RawPointer(TypePtr pointeeType)

Create a raw (non-owning) pointer type: raw_ptr<T> for C interop.

Related: TypePtr

Reference

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Reference(TypePtr referencedType, bool isMutable=true)

Create a reference type: ref(T) with implicit dereferencing.

Related: TypePtr

Slice

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Slice()

Slice type singleton: builtin { i64 start, i64 end } for indexing.

Related: TypePtr

StaticPointer

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::StaticPointer(TypePtr pointeeType)

Create a static pointer type: static_ptr<T> for immortal data Used for string literals and global constants - memory safe.

Related: TypePtr

String

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::String()

String literals are represented as static_ptr<u8> - immortal, read-only data.

Related: TypePtr

TypeParameter

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::TypeParameter(const std::string &name, TypeConstraint constraint={}, DeclarationId declaration={}, std::shared_ptr< const int > session={})

Create a type parameter carrying its optional requirement.

Related: TypePtr, TypeConstraint, DeclarationId

UInt16

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::UInt16()

Returns the shared semantic type descriptor for Sun uint16 values.

Related: TypePtr

UInt32

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::UInt32()

Returns the shared semantic type descriptor for Sun uint32 values.

Related: TypePtr

UInt64

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::UInt64()

Returns the shared semantic type descriptor for Sun uint64 values.

Related: TypePtr

UInt8

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::UInt8()

Returns the shared semantic type descriptor for Sun uint8 values.

Related: TypePtr

Void

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::Void()

Returns the shared semantic type descriptor for Sun void values.

Related: TypePtr

fromString

public · function · static · Source (opens in a new tab)

static TypePtr sun::types::Types::fromString(const std::string &name)

Parse a type name string to TypePtr.

Related: TypePtr