Skip to content

[Wildcard Variables] Support for wildcard record type positional fields #56271

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

Closed
2 tasks done
Tracked by #55680
pq opened this issue Jul 17, 2024 · 0 comments
Closed
2 tasks done
Tracked by #55680

[Wildcard Variables] Support for wildcard record type positional fields #56271

pq opened this issue Jul 17, 2024 · 0 comments
Assignees
Labels
feature-wildcard-variables Implementation of the wildcard variables feature legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@pq
Copy link
Member

pq commented Jul 17, 2024

typedef R = (String _, String _);
(int _, int _) record;

It is currently an error for a (positional) record field name to begin with _ (including just a bare _). We relax that error to only apply to record fields whose name begins with _ followed by at least one other character (even if those later character(s) are _).

Named fields of record types are unchanged. It is still a compile-time error for a named field name to start with _.

https://github.com/dart-lang/language/blob/main/working/wildcards/feature-specification.md#record-type-positional-fields


  • update INVALID_FIELD_NAME_PRIVATE to allow positional _s in record types.
  • update DUPLICATE_FIELD_NAME to allow multiple positional _s in record types
@pq pq changed the title Support for wildcard record type positional fields [Wildcard Variables] Support for wildcard record type positional fields Jul 17, 2024
@pq pq self-assigned this Jul 17, 2024
@pq pq added legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug feature-wildcard-variables Implementation of the wildcard variables feature P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jul 17, 2024
copybara-service bot pushed a commit that referenced this issue Jul 18, 2024
See: #56271

`DUPLICATE_FIELD_NAME` to be handled in a follow-up

Change-Id: I44b7302cc3d522636075e4ffccbf88c117306730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376203
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
@pq pq closed this as completed Jul 18, 2024
copybara-service bot pushed a commit that referenced this issue Jul 18, 2024
See: #56271

Change-Id: If471de5174f0ea1fae9daf6fbe3956a3abce40a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376460
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-wildcard-variables Implementation of the wildcard variables feature legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

1 participant