Merge branch 'master' of https://github.com/dart-lang/co19
diff --git a/LanguageFeatures/nnbd/late_A04_t04.dart b/LanguageFeatures/nnbd/late_A04_t04.dart
index ae1dcbe..822a1bd 100644
--- a/LanguageFeatures/nnbd/late_A04_t04.dart
+++ b/LanguageFeatures/nnbd/late_A04_t04.dart
@@ -19,6 +19,7 @@
* exception and the value of the variable was not written to then next read
* attempts to evaluate the initializer expression again
* @author sgrekhov@unipro.ru
+ * @issue 40390
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A05_t02.dart b/LanguageFeatures/nnbd/late_A05_t02.dart
index eb129cc..31b1c85 100644
--- a/LanguageFeatures/nnbd/late_A05_t02.dart
+++ b/LanguageFeatures/nnbd/late_A05_t02.dart
@@ -18,6 +18,7 @@
* variable has occurred, the read is treated as a first read and the
* initializer expression is evaluated again
* @author sgrekhov@unipro.ru
+ * @issue 40390
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A07_t01.dart b/LanguageFeatures/nnbd/late_A07_t01.dart
index a3f9022..ec78b74 100644
--- a/LanguageFeatures/nnbd/late_A07_t01.dart
+++ b/LanguageFeatures/nnbd/late_A07_t01.dart
@@ -12,6 +12,7 @@
*
* @description Check overriding of an implicit setter
* @author sgrekhov@unipro.ru
+ * @issue 40391
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A07_t02.dart b/LanguageFeatures/nnbd/late_A07_t02.dart
index fe7be16..ed781b1 100644
--- a/LanguageFeatures/nnbd/late_A07_t02.dart
+++ b/LanguageFeatures/nnbd/late_A07_t02.dart
@@ -12,6 +12,7 @@
*
* @description Check overriding of an implicit setter
* @author sgrekhov@unipro.ru
+ * @issue 40391
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A08_t03.dart b/LanguageFeatures/nnbd/late_A08_t03.dart
index 509eb9a..669f0c9 100644
--- a/LanguageFeatures/nnbd/late_A08_t03.dart
+++ b/LanguageFeatures/nnbd/late_A08_t03.dart
@@ -15,6 +15,7 @@
* @description Check that throwing an exception during initializer evaluation
* no longer sets a toplevel or static variable no null
* @author sgrekhov@unipro.ru
+ * @issue 40390
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A08_t04.dart b/LanguageFeatures/nnbd/late_A08_t04.dart
index badf45a..c71534c 100644
--- a/LanguageFeatures/nnbd/late_A08_t04.dart
+++ b/LanguageFeatures/nnbd/late_A08_t04.dart
@@ -15,6 +15,7 @@
* @description Check that throwing an exception during initializer evaluation
* no longer sets a toplevel or static variable no null
* @author sgrekhov@unipro.ru
+ * @issue 40390
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/late_A08_t05.dart b/LanguageFeatures/nnbd/late_A08_t05.dart
index 910a2d1..9c87633 100644
--- a/LanguageFeatures/nnbd/late_A08_t05.dart
+++ b/LanguageFeatures/nnbd/late_A08_t05.dart
@@ -15,6 +15,7 @@
* @description Check that reading the variable during initializer evaluation is
* no longer checked for, and does not cause an error.
* @author sgrekhov@unipro.ru
+ * @issue 40375
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong
diff --git a/LanguageFeatures/nnbd/legacy_libraries_A02_t01.dart b/LanguageFeatures/nnbd/legacy_libraries_A02_t01.dart
index 8ce0385..2b5651c 100644
--- a/LanguageFeatures/nnbd/legacy_libraries_A02_t01.dart
+++ b/LanguageFeatures/nnbd/legacy_libraries_A02_t01.dart
@@ -20,11 +20,11 @@
import "opted_in_lib.dart";
main() {
- C.bar();
+ A.bar();
test();
new C().test();
- C.bar(named: "Lily");
+ A.bar(named: "Lily");
test(named: "was");
new C().test(named: "here");
}
diff --git a/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart b/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart
index 115dda2..e124ee4 100644
--- a/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart
+++ b/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart
@@ -21,10 +21,17 @@
class C {
List<int>? _list = [3, 1, 4];
- int operator [](int index) => _list != null ? _list[index] : -1;
+ int operator [](int index) {
+ List<int>? list = _list;
+ if (list != null) {
+ return list[index];
+ }
+ return -1;
+ }
void operator []=(int index, dynamic value) {
- if (_list != null) {
- _list[index] = value;
+ List<int>? list = _list;
+ if (list != null) {
+ list[index] = value;
}
}
@@ -46,13 +53,7 @@
testShort(c1, 0, 7);
c1 = new C();
testShort(c1, 0, 7);
- if (c1 != null) {
- c1._list = null;
- testShort(c1, 0, 7);
- }
C c2 = new C();
testShort(c2, 0, 7);
- c2._list = null;
- testShort(c2, 0, 7);
}
\ No newline at end of file
diff --git a/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
index 5ee1b31..6392737 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A04_t01.dart
@@ -7,8 +7,7 @@
* @assertion An expression of the form e! evaluates e to a value v, throws a
* runtime error if v is null, and otherwise evaluates to v.
*
- * @description Check that an expression of the form e! evaluates e to a value
- * v, throws no runtime error if v is not null. Test 'super'
+ * @description Check that expression of the form 'super!' is a compile error
* @author sgrekhov@unipro.ru
* @issue 39723
* @issue 39598
@@ -29,15 +28,42 @@
class C extends A {
test() {
- super!; //# 01: static type warning
- super!.foo(); //# 02: static type warning
- super![42]; //# 03: static type warning
- super!?.foo(); //# 04: static type warning
- super!?.[42]; //# 05: static type warning
- super!.s = "Lily was here"; //# 06: static type warning
- super!?.s = "Lily was here"; //# 07: static type warning
- super![0] = "Lily was here"; //# 08: static type warning
- super!?.[0] = "Lily was here"; //# 09: static type warning
+ super!;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!.foo();
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super![42];
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!?.foo();
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!?.[42];
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!.s = "Lily was here";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!?.s = "Lily was here";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super![0] = "Lily was here";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ super!?.[0] = "Lily was here";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
super.getValue!;
super[42]!;
}
diff --git a/LanguageFeatures/nnbd/syntax_A01_t02.dart b/LanguageFeatures/nnbd/syntax_A01_t02.dart
index 77210cb..816fabf 100644
--- a/LanguageFeatures/nnbd/syntax_A01_t02.dart
+++ b/LanguageFeatures/nnbd/syntax_A01_t02.dart
@@ -11,6 +11,7 @@
* nullable version of that type. Test top-level types
* @author sgrekhov@unipro.ru
* @issue 40374
+ * @issue 39896
*/
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong