Workiva / built_redux

an implementation of redux written in dart that enforces immutability
MIT License
125 stars 46 forks source link

Child actions code generation fails on 8.0.0 #159

Open westracer opened 3 years ago

westracer commented 3 years ago

Version 7.5.11 works fine, but I have to override dependencies to use it.

Minimal reproducible example:

abstract class HomeActions implements ReduxActions {
  HomeActions._();
  factory HomeActions() = _$HomeActions;
}

abstract class AppActions extends ReduxActions {
  AppActions._();
  factory AppActions() = _$AppActions;

  HomeActions get home;
}

causes:

[INFO] built_redux:built_redux on lib/domain/actions/app_actions.dart:Generating action classes for AppActions [SEVERE] built_redux:built_redux on lib/domain/actions/app_actions.dart: An error FormatterException occurred while formatting the generated source for package:***/domain/actions/app_actions.dart which was output to lib/domain/actions/app_actions.built_redux.g.part. This may indicate an issue in the generator, the input source code, or in the source formatter. Could not format because the source could not be parsed:

line 21, column 27 of .: Expected an identifier. ╷ 21 │ final home = HomeActions*(); │ ^ ╵

Note: My project doesn't use NNBD.

westracer commented 3 years ago

Probably, there should be an option to generate code without null safety. For now, I have to pass "withNullability: false" to the getDisplayString method.