@@ -4,7 +4,7 @@ Author: Bob Nystrom
4
4
5
5
Status: Accepted
6
6
7
- Version 1.20 (see [ CHANGELOG] ( #CHANGELOG ) at end)
7
+ Version 1.21 (see [ CHANGELOG] ( #CHANGELOG ) at end)
8
8
9
9
## Motivation
10
10
@@ -462,6 +462,27 @@ var c = cond ? a : b; // c has type `Record`.
462
462
463
463
The greatest lower bound of records with different shapes is ` Never ` .
464
464
465
+ ### Combined member signatures
466
+
467
+ In order to determine how a combined member signature is computed when one
468
+ or more types in the signature is a record type, we need to extend the
469
+ definition of the type function ` NNBD_TOP_MERGE ` when it is applied to a
470
+ record type:
471
+
472
+ ` NNBD_TOP_MERGE ` is only defined when it is applied to two types with the
473
+ same structure, in particular: It is only defined on two record types when
474
+ they have the same shape.
475
+
476
+ When it is applied to two record types with the same shape, the result
477
+ is a record type with the same shape again, where each field type is
478
+ obtained by applying ` NNBD_TOP_MERGE ` recursively.
479
+
480
+ * For example:*
481
+
482
+ ```
483
+ NNBD_TOP_MERGE((int, {dynamic x}), (int, {void x})) == (int, {Object? x})
484
+ ```
485
+
465
486
### Type inference
466
487
467
488
Every record literal has a static type, which is associated with it via
@@ -829,6 +850,10 @@ library is sufficient to enforce this.*
829
850
830
851
## CHANGELOG
831
852
853
+ ### 1.21
854
+
855
+ - Specify handling of record types with ` NNBD_TOP_MERGE ` .
856
+
832
857
### 1.20
833
858
834
859
- Start positional record field getters at ` $1 ` , not ` $0 ` (#2638 ).
0 commit comments