Move away from using Map
constructor in 'Generics' examples
#5036
Labels
a.language
Relates to the Dart language tour
d.enhancement
Improves docs with specific ask
e1-hours
Can complete in < 8 hours of normal, not dedicated, work
from.team
Reported by Dash docs team member
from.to-do
Issue raised from inline TODO comment
p2-medium
Necessary but not urgent concern. Resolve when possible.
st.triage.ltw
Indicates Lead Tech Writer has triaged
Page URL
https://dart.dev/language/generics.html
Page source
https://github.com/dart-lang/site-www/tree/main/src/language/generics.md
Describe the problem
In Using parameterized types with constructors on https://github.com/dart-lang/site-www/blob/main/src/language/generics.md?plain=1#L122 we have an example that uses the normal constructor for an empty
Map
. This is not idiomatic Dart, since cases like that should use map literals.Expected fix
Adjust the example to use a different class besides
Map
.Additional context
No response
The text was updated successfully, but these errors were encountered: