@@ -6,7 +6,11 @@ Status: Draft
6
6
7
7
## CHANGELOG
8
8
9
- 2020..06.02
9
+ 2020.07.09
10
+ - Specify combined member signature and spread element typing
11
+ with null-safety.
12
+
13
+ 2020.06.02
10
14
- Fix the diff to the spec for potentially constant instance checks
11
15
- Specify that extensions do not apply to values of type ` Never `
12
16
- Specify the treatment of typedefs from legacy libraries
@@ -679,6 +683,22 @@ If no type is specified in a catch clause, then the default type of the error
679
683
variable is ` Object ` , instead of ` dynamic ` as was the case in pre-null safe
680
684
Dart.
681
685
686
+ #### Spread element typing
687
+
688
+ In a collection literal in Dart before null-safety, the inferred element
689
+ type of a spread element of the form ` ...?e ` where ` e ` has static type
690
+ ` Null ` is ` Null ` , and so are the inferred key type and value type.
691
+
692
+ With null-safety, when the static type of ` e ` is ` Null ` or a potentially
693
+ nullable subtype thereof, the inferred element, key, and value type
694
+ of ` ...?e ` is ` Never ` .
695
+
696
+ Similarly, when the static type of ` e ` is a subtype of ` Never ` ,
697
+ the element, key, and value type of ` ...e ` and ` ...?e ` is ` Never ` .
698
+
699
+ * When the static type _ S_ of ` e ` is strictly non-nullable, such as when _ S_
700
+ is ` Never ` , ` ...?e ` is a warning, but it may still occur.*
701
+
682
702
### Instantiate to bounds
683
703
684
704
The computation of instantiation to bounds is changed to substitute ` Never ` for
@@ -731,6 +751,25 @@ subtype of `S`.
731
751
732
752
The default bound of generic type parameters is treated as ` Object? ` .
733
753
754
+ ### Combined member signatures
755
+
756
+ [ This section] ( https://github.com/dart-lang/language/blob/9e12517922c1f0021aead2af163c3b502497f312/specification/dartLangSpec.tex#L4241 )
757
+ in the language specification defines the notion of a _ combined member
758
+ signature_ . In Dart before null-safety it is based on the textually first
759
+ superinterface that has a most specific signature. With null-safety it
760
+ is changed such that the all the most specific signatures are merged.
761
+
762
+ This is achieved by changing
763
+ [ this paragraph] ( https://github.com/dart-lang/language/blob/9e12517922c1f0021aead2af163c3b502497f312/specification/dartLangSpec.tex#L4373 )
764
+ to the following:
765
+
766
+ "Let _ m<sub >all</sub >_ be the result of applying ` NNBD_TOP_MERGE ` to
767
+ the elements in _ M<sub >all</sub >_ , ordered according to the interface
768
+ _ I<sub >1</sub > .. I<sub >k</sub >_ that each signature came from."
769
+
770
+ Moreover, the occurrence of _ m<sub >i</sub >_ in the next paragraph is
771
+ changed to _ m<sub >all</sub >_ .
772
+
734
773
### Implicit conversions
735
774
736
775
The implicit conversion of integer literals to double literals is performed when
0 commit comments