Skip to content

#212 Breaking/change default to string() implementation#213

Open
stan-at-work wants to merge 2 commits into
felangel:masterfrom
stan-at-work:breaking/change-default-toString()-implementation
Open

#212 Breaking/change default to string() implementation#213
stan-at-work wants to merge 2 commits into
felangel:masterfrom
stan-at-work:breaking/change-default-toString()-implementation

Conversation

@stan-at-work
Copy link
Copy Markdown

Issue #212

Status

READY

Breaking Changes

YES

Description

Change the default toString() implementation in equatable.dart and equatable_mixin.dart.
This changes changes return '$runtimeType'; -> return super.toString();

Todos

  • Tests
  • Documentation
  • Examples

Impact on Existing Codebases

This is a behavioral breaking change for any class that:

  1. Mixes in EquatableMixin, and
  2. Does not override toString() itself, and
  3. Inherits a non-default toString() from a superclass.

Additionally, any class extending Equatable or mixing in EquatableMixin that relies on the current '$runtimeType' string format will observe a change to Instance of 'ClassName'. Teams are advised to audit usages of .toString() (including implicit calls via string interpolation or print) on classes that extend or mix in equatable abstractions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant