sun::types::ModuleType
class · Source (opens in a new tab)
class sun::types::ModuleType : public sun::types::TypeModule/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
- sun::types::Type (public)
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 overrideReports 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 overrideReturns 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() constReturns the module path stored by this object.
toDisplayString
public · function · Source (opens in a new tab)
std::string sun::types::ModuleType::toDisplayString() const overrideThe 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 overrideModule 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 overrideReturns 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::ModuleNo documentation comment.
Related: Kind, Kind::Module
Private Fields
modulePath
private · variable · Source (opens in a new tab)
std::string sun::types::ModuleType::modulePathNo documentation comment.