Closed
Description
When the VM detects an LateInitializationError
with null safety, it throws a generic error like:
00:07 +5 -2: mergeWith Test [E]
LateInitializationError: internalHandler
package:functional_listener/src/functional_value_notifiers.dart FunctionalValueNotifier.internalHandler
package:functional_listener/src/functional_value_notifiers.dart 20:38 FunctionalValueNotifier.removeListener
package:functional_listener/src/functional_value_notifiers.dart 140:11 MergingValueNotifiers.removeListener
package:functional_listener/functional_listener.dart 223:17 ListenableSubscription.cancel
listenable_pipe_test.dart 160:18
This error does not detail which of the two cases of LateInitializationError happened: did we read something that wasn't initialized, or did we write to an already initialized final late variable.
It would be nice to either add this detail in the error output, or potentially even split LateInitializationError
into two errors (like LateUninitializedError
and LateFinalReInitializationError
).
Further it could be made a bit clearer which variable triggered the exception.