Skip to content

Commit 4e274d2

Browse files
committed
[patterns] Remove the reflection-like static methods on Record.
Fix #2127.
1 parent fda0657 commit 4e274d2

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

working/0546-patterns/records-feature-specification.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Author: Bob Nystrom
44

55
Status: In progress
66

7-
Version 1.1 (see [CHANGELOG](#CHANGELOG) at end)
7+
Version 1.2 (see [CHANGELOG](#CHANGELOG) at end)
88

99
## Motivation
1010

@@ -79,17 +79,10 @@ These primitive types are added to `dart:core`:
7979

8080
### The `Record` class
8181

82-
A built-in class whose signature is:
83-
84-
```dart
85-
abstract class Record {
86-
static Iterable<Object?> positionalFields(Record record);
87-
static Map<Symbol, Object?> namedFields(Record record);
88-
}
89-
```
90-
82+
A built-in class `Record` with no members except those inherited from `Object`.
9183
This type cannot be constructed, extended, mixed in, or implemented by
92-
user-defined classes.
84+
user-defined classes. *It's similar to how the `Function` class is the
85+
superclass for function types.*
9386

9487
### The `Destructure<n>` types
9588

@@ -229,7 +222,7 @@ handle function typedefs.)
229222

230223
### Members
231224

232-
A record type declares all of the members defined on Object. It also exposes
225+
A record type declares all of the members defined on `Object`. It also exposes
233226
getters for each named field where the name of the getter is the field's name
234227
and the getter's type is the field's type.
235228

@@ -255,9 +248,9 @@ The class `Record` is a subtype of `Object` and `dynamic` and a supertype of
255248

256249
A record type `A` is a subtype of record type `B` iff they have same shape and
257250
the types of all fields of `A` are subtypes of the corresponding field types of
258-
`B`. In type system lingo, this means record types are "covariant" or have
251+
`B`. *In type system lingo, this means record types are "covariant" or have
259252
"depth subtyping". Record types with different shapes are not subtypes. There is
260-
no "row polymorphism" or "width subtyping".
253+
no "row polymorphism" or "width subtyping".*
261254

262255
If a record type has positional fields, then it is a subtype of the
263256
`Destructure` interface with the same number of fields and with type arguments
@@ -411,6 +404,10 @@ covariant in their field types.
411404

412405
## CHANGELOG
413406

407+
### 1.2
408+
409+
- Remove the static methods on `Record` (#2127).
410+
414411
### 1.1
415412

416413
- Minor copy editing and clean up.

0 commit comments

Comments
 (0)