|
Yume
|
Represents a type in the type system. NOTE: that this isn't the class to use for type introspection, for that, Type should be used instead as it is fully qualified.
More...
#include <type_base.hpp>

Public Member Functions | |
| BaseType (const BaseType &) noexcept=delete | |
| BaseType (BaseType &&) noexcept=delete | |
| auto | operator= (const BaseType &) noexcept -> BaseType &=delete |
| auto | operator= (BaseType &&) noexcept -> BaseType &=delete |
| virtual | ~BaseType ()=default |
| auto | kind () const -> Kind |
| auto | base_name () const -> string |
| virtual auto | name () const -> string=0 |
Protected Member Functions | |
| BaseType (Kind kind, string name) | |
Represents a type in the type system. NOTE: that this isn't the class to use for type introspection, for that, Type should be used instead as it is fully qualified.
All kinds of types inherit from this class. Similar to AST nodes, Types cannot be copied or moved as all special member functions (aside from the destructor) are deleted.
There will always be one instance of a Type object for a specific type. This means that comparing if two types are the same type is simply a pointer equality check.
The single instance of most types is located in TypeHolder, however "qualified" types are instead stored in instances of Type. A "qualified" type is, for example, mut. These qualifiers do not stack. Getting the "mut" reference to a mutable reference should be itself.
Also, pointer-like types are also not held in TypeHolder, and are instead stored in the m_known_... fields of their pointee type.
Definition at line 42 of file type_base.hpp.
|
deletenoexcept |
|
deletenoexcept |
|
virtualdefault |
|
inlineprotected |
Definition at line 62 of file type_base.hpp.
|
inline |
Definition at line 58 of file type_base.hpp.
Referenced by yume::ty::Int::name(), yume::ty::Struct::name(), yume::ty::Function::name(), yume::ty::Generic::name(), yume::ty::OpaqueSelf::name(), and yume::ty::Meta::name().
|
inline |
Definition at line 57 of file type_base.hpp.
Referenced by yume::ty::Type::compatibility().
|
pure virtual |
Implemented in yume::ty::Int, yume::ty::Nil, yume::ty::Ptr, yume::ty::Struct, yume::ty::Function, yume::ty::Generic, yume::ty::OpaqueSelf, and yume::ty::Meta.