summaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-14 10:59:18 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-14 10:59:18 +0800
commitf043a45fd21bab906cafc8964a892a64def65ec9 (patch)
tree63217329f82a015cff4fc6e78e37be606065ff64 /src/types.cpp
parent432892ea9ce604b6d12d6b087ad6328eb335f70c (diff)
downloadmrust-f043a45fd21bab906cafc8964a892a64def65ec9.tar.gz
Remove requirement for all variants of tagged unions to be empty-constructable
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 845af9d2..f3777666 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -798,7 +798,7 @@ void operator%(::Deserialiser& s, TypeData::Tag& c) {
}
#define _S(VAR, ...) case TypeData::TAG_##VAR: { const auto& ent = m_data.as_##VAR(); (void)&ent; __VA_ARGS__ } break;
-#define _D(VAR, ...) case TypeData::TAG_##VAR: { m_data = TypeData::make_null_##VAR(); auto& ent = m_data.as_##VAR(); (void)&ent; __VA_ARGS__ } break;
+#define _D(VAR, ...) case TypeData::TAG_##VAR: { m_data = TypeData::make_##VAR({}); auto& ent = m_data.as_##VAR(); (void)&ent; __VA_ARGS__ } break;
SERIALISE_TYPE(TypeRef::, "TypeRef", {
s % m_data.tag();
switch(m_data.tag())
@@ -854,6 +854,7 @@ SERIALISE_TYPE(TypeRef::, "TypeRef", {
_D(Any)
_D(Unit)
_D(Macro,
+ m_data = TypeData::make_Macro({});
s.item( ent.inv );
)
_D(Primitive,