Combine recursive and nonrecursive single-tag glue

This commit is contained in:
Richard Feldman 2022-08-07 17:09:41 -04:00
parent 4e73899356
commit 6e7f0210da
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -245,7 +245,16 @@ fn add_type(target_info: TargetInfo, id: TypeId, types: &Types, impls: &mut Impl
types,
impls,
),
RocTagUnion::RecursiveSingleTag { .. } => {
RocTagUnion::RecursiveSingleTag {
name,
tag_name,
payload,
}
| RocTagUnion::NonRecursiveSingleTag {
name,
tag_name,
payload: Some(payload),
} => {
todo!();
}
RocTagUnion::NonRecursiveSingleTag {
@ -253,7 +262,7 @@ fn add_type(target_info: TargetInfo, id: TypeId, types: &Types, impls: &mut Impl
tag_name,
payload: None,
} => {
// An enumeration with one tag is a zero-sized unit type, so
// A single tag with no payload is a zero-sized unit type, so
// represent it as a zero-sized struct (e.g. "struct Foo()").
let derive = derive_str(
&RocType::Struct {