Skip to content

Commit

Permalink
fix empty enum panic
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdotink committed Jan 9, 2024
1 parent 3747b89 commit 0dde32a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zap/src/parser/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ impl<'src> Converter<'src> {
SyntaxEnumKind::Tagged { tag, variants } => {
let tag_name = self.str(tag);

if variants.is_empty() {
self.report(Report::AnalyzeEmptyEnum { span });
}

let variants = variants
.iter()
.map(|(variant_name, variant_struct)| {
Expand Down

0 comments on commit 0dde32a

Please sign in to comment.