Skip to content

Commit

Permalink
fix: ModelRefBase types are now matched.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jul 11, 2023
1 parent b2052c1 commit d91d3e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/masamune_builder/lib/model/model_class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ List<Spec> modelClass(
}),
])
..static = true
..returns = const Reference("ModelRefBase")
..returns = Reference("ModelRefBase<${model.name}>")
..lambda = true
..body = Code(
"ModelRefBase.fromPath(\"${path.path.replaceAllMapped(_pathRegExp, (m) => "\$${m.group(1)?.toCamelCase() ?? ""}")}/\$key\")",
"ModelRefBase<${model.name}>.fromPath(\"${path.path.replaceAllMapped(_pathRegExp, (m) => "\$${m.group(1)?.toCamelCase() ?? ""}")}/\$key\")",
),
),
if (searchable.isNotEmpty)
Expand Down Expand Up @@ -685,10 +685,10 @@ List<Spec> modelClass(
}),
])
..static = true
..returns = const Reference("ModelRefBase")
..returns = Reference("ModelRefBase<${model.name}>")
..lambda = true
..body = Code(
"ModelRefBase.fromPath(\"${mirror.path.replaceAllMapped(_pathRegExp, (m) => "\$${m.group(1)?.toCamelCase() ?? ""}")}/\$key\")",
"ModelRefBase<${model.name}>.fromPath(\"${mirror.path.replaceAllMapped(_pathRegExp, (m) => "\$${m.group(1)?.toCamelCase() ?? ""}")}/\$key\")",
),
),
if (searchable.isNotEmpty)
Expand Down

0 comments on commit d91d3e9

Please sign in to comment.