fix generics

This commit is contained in:
2026-05-08 17:00:03 +02:00
parent 0e6c73e85c
commit ed4a505a6a
3 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -260,8 +260,8 @@ impl From<pest::iterators::Pair<'_, Rule>> for TopLevelKind {
name: Identifier::from(inner.next().unwrap()),
generics: consume_rule(&mut inner, Rule::generics)
.map(Generics::from)
.unwrap_or(Generics(Vec::new())),
fields: FieldList::from(inner.next().unwrap()),
.unwrap_or_default(),
fields: inner.next().map(FieldList::from).unwrap_or_default(),
},
Rule::class_decl => TopLevelKind::ClassDecl {