sun::types::TypeParameterType
class · Source (opens in a new tab)
class sun::types::TypeParameterType : public sun::types::TypeType parameter (used in generic class/function definitions) Represents a type variable like T, U, V in class List<T>.
Inherits
- sun::types::Type (public)
Public Functions
- TypeParameterType
- equals
- getConstraint
- getKind
- getName
- getProjection
- getProjectionBase
- hasConstraint
- project
- toDisplayString
- toLLVMType
- toString
TypeParameterType
public · function · Source (opens in a new tab)
sun::types::TypeParameterType::TypeParameterType(std::string paramName, TypeConstraint constraint={}, TypeProjection projection=TypeProjection::None, DeclarationId declaration={}, std::shared_ptr< const int > session={})Creates a generic type parameter retaining its constraint and declaration identity.
Related: TypeConstraint, TypeProjection, TypeProjection::None, DeclarationId
equals
public · function · Source (opens in a new tab)
bool sun::types::TypeParameterType::equals(const Type &other) const overrideReports whether the other type has the same semantic identity.
Related: Type
getConstraint
public · function · Source (opens in a new tab)
const TypeConstraint & sun::types::TypeParameterType::getConstraint() constThe complete requirement carried by this parameter.
Related: TypeConstraint
getKind
public · function · Source (opens in a new tab)
Kind sun::types::TypeParameterType::getKind() const overrideReturns the type category used for semantic checks and dispatch.
Related: Kind
getName
public · function · Source (opens in a new tab)
const std::string & sun::types::TypeParameterType::getName() constReturns the declared name used to identify this object.
getProjection
public · function · Source (opens in a new tab)
TypeProjection sun::types::TypeParameterType::getProjection() constReturns the projection stored by this object.
Related: TypeProjection
getProjectionBase
public · function · Source (opens in a new tab)
const std::string & sun::types::TypeParameterType::getProjectionBase() constReturns the projection base stored by this object.
hasConstraint
public · function · Source (opens in a new tab)
bool sun::types::TypeParameterType::hasConstraint() constReports whether this object has constraint.
project
public · function · Source (opens in a new tab)
TypePtr sun::types::TypeParameterType::project(TypeProjection projection) constRetain the binder identity when projecting its eventual concrete type.
Related: TypePtr, TypeProjection
toDisplayString
public · function · Source (opens in a new tab)
std::string sun::types::TypeParameterType::toDisplayString() const overrideReturns a source-facing type name without internal compiler prefixes.
toLLVMType
public · function · Source (opens in a new tab)
llvm::Type * sun::types::TypeParameterType::toLLVMType(llvm::LLVMContext &ctx) const overrideType parameters can't be directly converted to LLVM types They must be substituted first.
Related: Type
toString
public · function · Source (opens in a new tab)
std::string sun::types::TypeParameterType::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::TypeParameterType::StaticKind = Kind::TypeParameterNo documentation comment.
Related: Kind, Kind::TypeParameter
Private Fields
base_
private · variable · Source (opens in a new tab)
std::string sun::types::TypeParameterType::base_No documentation comment.
constraint_
private · variable · Source (opens in a new tab)
TypeConstraint sun::types::TypeParameterType::constraint_No documentation comment.
Related: TypeConstraint
declaration_
private · variable · Source (opens in a new tab)
DeclarationId sun::types::TypeParameterType::declaration_No documentation comment.
Related: DeclarationId
name
private · variable · Source (opens in a new tab)
std::string sun::types::TypeParameterType::nameNo documentation comment.
projection_
private · variable · Source (opens in a new tab)
TypeProjection sun::types::TypeParameterType::projection_ = TypeProjection::NoneNo documentation comment.
Related: TypeProjection, TypeProjection::None
session_
private · variable · Source (opens in a new tab)
std::shared_ptr<const int> sun::types::TypeParameterType::session_No documentation comment.