|
Yume
|
A "qualified" type, with a non-stackable qualifier, i.e. mut.
More...
#include <type_base.hpp>
Public Member Functions | |
| Type (nonnull< const BaseType * > base, bool mut, bool ref) noexcept | |
| Type (nonnull< const BaseType * > base) noexcept | |
| auto | operator<=> (const Type &) const noexcept=default |
| auto | opaque_equal (const Type &other) const noexcept -> bool |
| auto | kind () const noexcept -> Kind |
| auto | base () const noexcept -> nonnull< const BaseType * > |
| template<typename T > | |
| auto | base_cast () const noexcept -> nonnull< const T * > |
| template<typename T > | |
| auto | base_dyn_cast () const noexcept -> nullable< const T * > |
| template<typename T > | |
| auto | try_as () const noexcept -> optional< Type > |
| template<typename T > | |
| auto | base_isa () const noexcept -> bool |
| auto | has_qualifier (Qualifier qual) const -> bool |
| auto | name () const -> string |
| auto | base_name () const -> string |
| auto | determine_generic_subs (Type generic, const Substitutions &subs) const -> optional< Substitutions > |
| auto | apply_generic_substitution (const Substitutions &sub) const -> Type |
| auto | compatibility (Type other, Compat compat=Compat()) const -> Compat |
| auto | known_qual (Qualifier qual) const -> Type |
| Get this type with a given qualifier applied. More... | |
| auto | known_ptr () const -> Type |
| auto | known_mut () const -> Type |
| auto | known_ref () const -> Type |
| auto | known_meta () const -> Type |
| auto | known_opaque () const -> Type |
| auto | coalesce (Type other) const noexcept -> optional< Type > |
The union of this and other. For example, the union of T and T mut is T mut. More... | |
| auto | intersect (Type other) const noexcept -> optional< Type > |
Return the intersection of this and other. For example, the intersection of T and T mut is T. More... | |
| auto | is_mut () const noexcept -> bool |
| auto | is_ref () const noexcept -> bool |
| auto | is_unqualified () const noexcept -> bool |
| auto | is_slice () const noexcept -> bool |
| auto | is_generic () const noexcept -> bool |
| auto | is_opaque_self () const noexcept -> bool |
| auto | is_meta () const noexcept -> bool |
| auto | is_trivially_destructible () const -> bool |
| auto | mut_base () const noexcept -> optional< Type > |
If this type is a mutable reference, return the base of it (T mut -> T) More... | |
| auto | ensure_mut_base () const noexcept(false) -> Type |
If this type is a mutable reference, return the base of it (T mut -> T) More... | |
| auto | ptr_base () const noexcept -> optional< Type > |
If this type is a pointer type, return the base of it (T ptr -> T) More... | |
| auto | ensure_ptr_base () const noexcept(false) -> Type |
If this type is a pointer type, return the base of it (T ptr -> T) More... | |
| auto | without_mut () const noexcept -> Type |
| If this type is a mutable reference, return the base of it, otherwise return itself. More... | |
| auto | without_opaque () const noexcept -> Type |
| If this type is a opaque wrapper type, return the wrapper type, otherwise return itself. More... | |
| auto | without_meta () const noexcept -> Type |
| auto | generic_base () const noexcept -> Type |
A "qualified" type, with a non-stackable qualifier, i.e. mut.
Definition at line 66 of file type_base.hpp.
Definition at line 72 of file type_base.hpp.
Referenced by mut_base().
Definition at line 73 of file type_base.hpp.
| auto yume::ty::Type::apply_generic_substitution | ( | const Substitutions & | sub | ) | const -> Type |
Definition at line 279 of file type.cpp.
References base().
Referenced by yume::semantic::OverloadSet::is_valid_overload().
Definition at line 79 of file type_base.hpp.
Referenced by apply_generic_substitution(), and is_slice().
|
inlinenoexcept |
Definition at line 80 of file type_base.hpp.
Referenced by yume::Compiler::destruct(), and yume::ty::visit_subs().
|
inlinenoexcept |
Definition at line 81 of file type_base.hpp.
Referenced by yume::Compiler::destruct(), and yume::ty::visit_subs().
|
inlinenoexcept |
Definition at line 90 of file type_base.hpp.
Referenced by yume::ty::visit_subs().
Definition at line 135 of file type.cpp.
References yume::ty::BaseType::kind(), and yume::ty::Compat::valid.
| auto yume::ty::Type::determine_generic_subs | ( | Type | generic, |
| const Substitutions & | subs | ||
| ) | const -> optional<Substitutions> |
Definition at line 96 of file type.cpp.
References yume::ty::visit_subs(), and YUME_ASSERT.
Referenced by yume::semantic::OverloadSet::is_valid_overload().
|
noexcept |
If this type is a mutable reference, return the base of it (T mut -> T)
| if | this type isn't a mutable reference. |
Definition at line 387 of file type.cpp.
References is_mut().
Referenced by yume::ty::visit_subs().
|
noexcept |
If this type is a pointer type, return the base of it (T ptr -> T)
| if | this type isn't a pointer type. |
Definition at line 399 of file type.cpp.
Referenced by is_generic().
|
noexcept |
Definition at line 441 of file type.cpp.
References YUME_ASSERT.
| auto yume::ty::Type::has_qualifier | ( | Qualifier | qual | ) | const -> bool |
|
noexcept |
Definition at line 221 of file type.cpp.
References ensure_ptr_base(), is_generic(), and without_meta().
Referenced by is_generic(), yume::semantic::OverloadSet::is_valid_overload(), and yume::ty::visit_subs().
|
noexcept |
Definition at line 251 of file type.cpp.
Referenced by yume::ty::visit_subs().
|
inlinenoexcept |
Definition at line 114 of file type_base.hpp.
Referenced by yume::Compiler::destruct(), ensure_mut_base(), mut_base(), and yume::ty::visit_subs().
|
noexcept |
|
inlinenoexcept |
Definition at line 115 of file type_base.hpp.
|
noexcept |
Definition at line 242 of file type.cpp.
References base(), and yume::ast::StructDecl::BUILTIN_TYPE_SLICE.
Referenced by yume::Compiler::destruct(), and is_trivially_destructible().
| auto yume::ty::Type::is_trivially_destructible | ( | ) | const -> bool |
Definition at line 253 of file type.cpp.
References yume::ast::AST::ensure_ty(), is_slice(), and name().
Referenced by yume::Compiler::destruct().
|
inlinenoexcept |
Definition at line 116 of file type_base.hpp.
Referenced by yume::semantic::TypeWalker::expression().
|
inlinenoexcept |
Definition at line 78 of file type_base.hpp.
|
inline |
Definition at line 104 of file type_base.hpp.
References known_qual(), and yume::Type.
Referenced by yume::semantic::TypeWalker::expression().
|
inline |
Definition at line 102 of file type_base.hpp.
References known_qual(), and yume::Mut.
|
inline |
Definition at line 105 of file type_base.hpp.
References known_qual(), and yume::Opaque.
|
inline |
Definition at line 101 of file type_base.hpp.
References known_qual(), and yume::Ptr.
Get this type with a given qualifier applied.
Definition at line 31 of file type.cpp.
References yume::Mut, yume::Opaque, yume::Ptr, yume::Ref, and yume::Type.
Referenced by known_meta(), known_mut(), known_opaque(), known_ptr(), and known_ref().
|
inline |
Definition at line 103 of file type_base.hpp.
References known_qual(), and yume::Ref.
|
noexcept |
If this type is a mutable reference, return the base of it (T mut -> T)
nullopt if this type isn't a mutable reference. Definition at line 381 of file type.cpp.
References is_mut(), and Type().
Referenced by yume::Compiler::destruct().
| auto yume::ty::Type::name | ( | ) | const -> string |
Definition at line 450 of file type.cpp.
References yume::Mut, name(), yume::ty::qual_suffix(), and yume::Ref.
Referenced by is_trivially_destructible(), yume::semantic::OverloadSet::is_valid_overload(), name(), and yume::ty::Ptr::name().
|
noexcept |
|
defaultnoexcept |
|
noexcept |
If this type is a pointer type, return the base of it (T ptr -> T)
nullopt if this type isn't a pointer type. Definition at line 393 of file type.cpp.
Referenced by yume::ty::visit_subs().
|
inlinenoexcept |
Definition at line 84 of file type_base.hpp.
|
noexcept |
Definition at line 435 of file type.cpp.
Referenced by is_generic(), and yume::ty::visit_subs().
|
noexcept |
|
noexcept |