Skip to content

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

@pq

Description

@pq
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

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresfeature-wildcard-variablesImplementation of the wildcard variables featurelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions