Skip to content

Commit 4470d5b

Browse files
committed
fix_thunk_and_repatch_generic_generation - only rplace if Builder is dynamic, add log
1 parent 4ef4fab commit 4470d5b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/generator.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ String _generateActions(ClassElement element) {
3939
var initializerCode = '''
4040
class _\$${element.name} extends ${element.name}{
4141
factory _\$${element.name}() => new _\$${element.name}._();
42-
42+
4343
_\$${element.name}._() : super._();
44-
44+
4545
$defaultFunctionDeclaration;
4646
}''';
4747

@@ -126,7 +126,11 @@ String _getActionDispatcherGenericType(FieldElement e) {
126126
b.name.startsWith('Built') &&
127127
i != boundParams.length - 1) {
128128
final next = boundParams.elementAt(i + 1);
129-
if (next != null && next.name.startsWith('Builder')) {
129+
if (next != null &&
130+
next.name.startsWith('Builder') &&
131+
typeArguments.elementAt(i + 1) == 'dynamic') {
132+
log.info(
133+
"replacing unresolved builder name ${typeArguments.elementAt(i)}Builder");
130134
// if it is a builder replace typeArguments at this location as
131135
// the Built's name + Builder
132136
typeArguments.replaceRange(

0 commit comments

Comments
 (0)