Skip to content

Documentation for builtin collection should talk about deep equality #31991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
mraleph opened this issue Jan 28, 2018 · 1 comment
Open
3 tasks

Documentation for builtin collection should talk about deep equality #31991

mraleph opened this issue Jan 28, 2018 · 1 comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core type-documentation A request to add or improve documentation

Comments

@mraleph
Copy link
Member

mraleph commented Jan 28, 2018

Dart's builtin collections unlike collections in other languages are not compared deeply for equality - instead you need to use helpers from package:collection (e.g. ListEquality).

This fact is not in any way mentioned in the documentation for builtin classes like Set and List making it hard to discover.

I think documentation should explicitly contain the following:

  • mention the fact that operator== on collections is not comparing collections contents.
  • mention the fact that package:collection contains relevant helpers;
  • provide explicit rationale for why default behavior of operator== was chosen - because it is somewhat counterintuitive.

/cc @leafpetersen @lrhn @eernstg

@mraleph mraleph added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). area-documentation Prefer using 'type-documentation' and a specific area label. labels Jan 28, 2018
@passsy
Copy link

passsy commented Jan 28, 2018

Relates #17963, #2217

@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core type-documentation A request to add or improve documentation and removed area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). area-documentation Prefer using 'type-documentation' and a specific area label. labels Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core type-documentation A request to add or improve documentation
Projects
None yet
Development

No branches or pull requests

3 participants