Skip to content

Commit 14841eb

Browse files
author
Illia Aihistov
committed
fix: handle null field types in parameters parser and refine macro circular dependency detection logic
1 parent 8526b44 commit 14841eb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/src/utils/docs_parser/parsers/parameters_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ParametersParser {
5252
if (variableName.startsWith('_')) continue;
5353

5454
final name = ParserUtils.camelCaseToSnakeCase(variableName);
55-
var type = member.fields.type.toString();
55+
var type = member.fields.type?.toString() ?? 'dynamic';
5656
type = type.replaceAllMapped(ParserRegexes.wordRegex, (match) {
5757
final word = match.group(0)!;
5858
return customTypes[word] ?? word;

lib/src/utils/docs_parser/utils/parser_utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ class ParserUtils {
8888

8989
if (newExpanded == expanded) break;
9090

91-
if (i == _maxMacroDepth - 1) {
91+
expanded = newExpanded;
92+
93+
if (i == _maxMacroDepth - 1 && expanded.contains('{@macro')) {
9294
throw 'Circular macro dependency detected or macro expansion depth '
9395
'exceeded the limit of $_maxMacroDepth';
9496
}
95-
96-
expanded = newExpanded;
9797
}
9898
}
9999

0 commit comments

Comments
 (0)