Skip to content
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

Somewhat misleading regarding naming record types #6409

Open
1 task
christerswahn opened this issue Feb 12, 2025 · 1 comment
Open
1 task

Somewhat misleading regarding naming record types #6409

christerswahn opened this issue Feb 12, 2025 · 1 comment
Labels
from.page-issue Reported in a reader-filed concern

Comments

@christerswahn
Copy link

Page URL

https://dart.dev/language/records/

Page source

https://github.com/dart-lang/site-www/tree/main/src/content/language/records.md

Describe the problem

This paragraph appears somewhat misleading:

There is no type declaration for individual record types. Records are structurally typed based on the types of their fields. A record's shape (the set of its fields, the fields' types, and their names, if any) uniquely determines the type of a record.

But it is possible to typedef a record type, and then use that type as parameter type or return type from a function for example.

This page never describes or shows with an example that a record type can be given a name for ease of use (even if a unique name will not cause records of the same shape to be distinct).

Expected fix

This could be explained better and / or shown with example with the objective to encourage easier-to-use records.

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@christerswahn christerswahn added the from.page-issue Reported in a reader-filed concern label Feb 12, 2025
@MiniPiku
Copy link
Contributor

MiniPiku commented Feb 16, 2025

fixed this take ,kindly take a look
Record type misleading issue #6426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from.page-issue Reported in a reader-filed concern
Projects
None yet
Development

No branches or pull requests

2 participants