Spicy
Public Member Functions | Static Public Member Functions | List of all members
hilti::type::Union Class Reference

#include <union.h>

Inheritance diagram for hilti::type::Union:
hilti::TypeBase hilti::type::trait::isAllocable hilti::type::trait::isParameterized hilti::type::trait::isMutable hilti::NodeBase hilti::trait::isType hilti::trait::isNode hilti::trait::isNode

Public Member Functions

 Union (std::vector< Declaration > fields, Meta m=Meta())
 
 Union (Wildcard, Meta m=Meta())
 
auto fields () const
 
hilti::optional_ref< const declaration::Fieldfield (const ID &id) const
 
unsigned int index (const ID &id) const
 
bool operator== (const Union &other) const
 
auto isEqual (const Type &other) const
 
auto _isResolved (ResolvedState *rstate) const
 
auto typeParameters () const
 
auto isWildcard () const
 
auto properties () const
 
- Public Member Functions inherited from hilti::NodeBase
 NodeBase (Meta meta)
 
 NodeBase (std::vector< Node > children, Meta meta)
 
template<typename T >
const T & child (int i) const
 
template<typename T >
void assertChildIsA (int i)
 
template<typename T >
auto children (int begin, int end) const
 
auto childRefs (int begin, int end)
 
template<typename T >
hilti::node::Set< T > childrenOfType () const
 
template<typename T >
std::vector< NodeRefchildRefsOfType () const
 
void addChild (Node n)
 
const auto & children () const
 
auto & children ()
 
auto & meta () const
 
void setMeta (Meta m)
 
bool pruneWalk () const
 

Static Public Member Functions

static Union addField (const Union &s, declaration::Field f)
 

Detailed Description

AST node for a struct type.

Member Function Documentation

◆ _isResolved()

auto hilti::type::Union::_isResolved ( ResolvedState *  rstate) const
inline

Implements the Type interface.

◆ addField()

static Union hilti::type::Union::addField ( const Union s,
declaration::Field  f 
)
inlinestatic

Copies an existing type and adds a new field to the copy.

Parameters
soriginal type
ffield to add
Returns
new typed with field added

◆ isEqual()

auto hilti::type::Union::isEqual ( const Type other) const
inline

Implements the Type interface.

◆ isWildcard()

auto hilti::type::Union::isWildcard ( ) const
inline

Implements the Type interface.

◆ properties()

auto hilti::type::Union::properties ( ) const
inline

Implements the Node interface.

◆ typeParameters()

auto hilti::type::Union::typeParameters ( ) const
inline

Implements the Type interface.


The documentation for this class was generated from the following file: