empty_ record_ type_ named_ fields_ list
Details about the 'empty_record_type_named_fields_list' diagnostic produced by the Dart analyzer.
The list of named fields in a record type can't be empty.
Description
#The analyzer produces this diagnostic when a record type has an empty list of named fields.
Example
#The following code produces this diagnostic because the record type has an empty list of named fields:
void f((int, int, {}) r) {}
Common fixes
#If the record is intended to have named fields, then add the types and names of the fields:
void f((int, int, {int z}) r) {}
If the record isn't intended to have named fields, then remove the curly braces:
void f((int, int) r) {}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Report an issue.