Documentation for builtin collection should talk about deep equality #31991
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
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
andList
making it hard to discover.I think documentation should explicitly contain the following:
operator==
on collections is not comparing collections contents.package:collection
contains relevant helpers;operator==
was chosen - because it is somewhat counterintuitive./cc @leafpetersen @lrhn @eernstg
The text was updated successfully, but these errors were encountered: