@@ -27,14 +27,13 @@ typedef CompoundTearOff<T extends CompoundDeclaration> =
2727 required List <AvailabilityInfo > availability,
2828 });
2929
30- typedef ParsedCompound <T > = ({T compound, List <Declaration > excessMembers});
31-
32- ParsedCompound <T > parseCompoundDeclaration <T extends CompoundDeclaration >(
30+ List <Declaration > parseCompoundDeclaration <T extends CompoundDeclaration >(
3331 Context context,
3432 ParsedSymbol symbol,
3533 ParsedSymbolgraph symbolgraph,
36- CompoundTearOff <T > tearoffConstructor,
37- ) {
34+ CompoundTearOff <T > tearoffConstructor, {
35+ void Function (T compound, List <Declaration > excessMembers)? onExcessMembers,
36+ }) {
3837 final compoundId = parseSymbolId (symbol.json);
3938
4039 final compoundRelations =
@@ -126,15 +125,17 @@ ParsedCompound<T> parseCompoundDeclaration<T extends CompoundDeclaration>(
126125
127126 compound.nestedDeclarations.fillNestingParents (compound);
128127
129- return (compound: compound, excessMembers: memberDeclarations);
128+ onExcessMembers? .call (compound, memberDeclarations);
129+
130+ return symbol.declarations;
130131}
131132
132133List <Declaration > parseClassDeclaration (
133134 Context context,
134135 ParsedSymbol classSymbol,
135136 ParsedSymbolgraph symbolgraph,
136137) {
137- parseCompoundDeclaration (
138+ return parseCompoundDeclaration (
138139 context,
139140 classSymbol,
140141 symbolgraph,
@@ -154,15 +155,14 @@ List<Declaration> parseClassDeclaration(
154155 nestedDeclarations: [],
155156 ),
156157 );
157- return classSymbol.declarations;
158158}
159159
160160List <Declaration > parseStructDeclaration (
161161 Context context,
162162 ParsedSymbol structSymbol,
163163 ParsedSymbolgraph symbolgraph,
164164) {
165- parseCompoundDeclaration (
165+ return parseCompoundDeclaration (
166166 context,
167167 structSymbol,
168168 symbolgraph,
@@ -182,5 +182,4 @@ List<Declaration> parseStructDeclaration(
182182 nestedDeclarations: [],
183183 ),
184184 );
185- return structSymbol.declarations;
186185}
0 commit comments