diff options
Diffstat (limited to 'src/ast/ast.hpp')
-rw-r--r-- | src/ast/ast.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp index 63a8b751..597d9bdc 100644 --- a/src/ast/ast.hpp +++ b/src/ast/ast.hpp @@ -351,11 +351,23 @@ public: const GenericParams& params() const { return m_params; }
GenericParams& params() { return m_params; }
- TypeRef get_field_type(const char *name, const ::std::vector<TypeRef>& args);
-
Struct clone() const;
};
+class Union
+{
+public:
+ GenericParams m_params;
+ ::std::vector<StructItem> m_variants;
+
+ Union( GenericParams params, ::std::vector<StructItem> fields ):
+ m_params( move(params) ),
+ m_variants( mv$(fields) )
+ {}
+
+ Union clone() const;
+};
+
class ImplDef
{
Span m_span;
@@ -572,6 +584,7 @@ TAGGED_UNION_EX(Item, (), None, (Type, TypeAlias),
(Struct, Struct),
(Enum, Enum),
+ (Union, Union),
(Trait, Trait),
(Function, Function),
|