sun::types::ModuleType

sun::types::ModuleType

class · Source (opens in a new tab)

class sun::types::ModuleType : public sun::types::Type

Module/namespace reference type Used in semantic analysis when accessing module-scoped variables/functions e.g., in "mod_x.mod_y.a", mod_x and mod_x.mod_y have ModuleType.

Inherits

Public Functions

ModuleType

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

sun::types::ModuleType::ModuleType(std::string path)

Creates a type describing a reference to a module path.

equals

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

bool sun::types::ModuleType::equals(const Type &other) const override

Reports whether the other type has the same semantic identity.

Related: Type

getKind

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

Kind sun::types::ModuleType::getKind() const override

Returns the type category used for semantic checks and dispatch.

Related: Kind

getModulePath

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

const std::string & sun::types::ModuleType::getModulePath() const

Returns the module path stored by this object.

toDisplayString

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

std::string sun::types::ModuleType::toDisplayString() const override

The path as source spells it, without the "$hash$" scope a moon import adds.

toLLVMType

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

llvm::Type * sun::types::ModuleType::toLLVMType(llvm::LLVMContext &ctx) const override

Module types don't have LLVM representation - they're resolved at compile time.

toString

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

std::string sun::types::ModuleType::toString() const override

Returns a readable representation for diagnostics and debugging.

Public Fields

StaticKind

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

Kind sun::types::ModuleType::StaticKind = Kind::Module

No documentation comment.

Related: Kind, Kind::Module

Private Fields

modulePath

private · variable · Source (opens in a new tab)

std::string sun::types::ModuleType::modulePath

No documentation comment.