#491. Generic function type null-check operator tests fixed
diff --git a/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart
index 311376a..4620f75 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A02_t01.dart
@@ -31,7 +31,7 @@
}
Function? f3 = null;
- Expect.throws(() {f3<int>!(42);});
+ Expect.throws(() {f3!<int>(42);});
Function f4 = bar;
if (f4 != null) {
Expect.throws(() {f4<int>(42)!;});
diff --git a/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
index 7286496..9f22f12 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A02_t02.dart
@@ -26,7 +26,7 @@
}
Function f2 = bar;
- f2<int>!(42);
+ f2!<int>(42);
if (f2 != null) {
f2<int>(42)!;
}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A02_t03.dart b/LanguageFeatures/nnbd/null_check_operator_A02_t03.dart
new file mode 100644
index 0000000..0bf07f6
--- /dev/null
+++ b/LanguageFeatures/nnbd/null_check_operator_A02_t03.dart
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @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 wrong syntax for the
+ * generic function type
+ * @author sgrekhov@unipro.ru
+ * @issue 39723
+ * @issue 39758
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+Object? foo(int i) => "Lily was here";
+
+main() {
+ Function f2 = foo;
+ f2<int>!(42);
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart
index fc80de5..c92b12c 100644
--- a/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart
+++ b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart
@@ -32,17 +32,17 @@
}
main() {
- new A<String>.named("Gaudeamus igitur")!;
- new A<String>.named("Gaudeamus igitur")!.foo();
- new A<String>.named("Gaudeamus igitur")![42];
- new A<String>.named("Gaudeamus igitur")!?.foo();
- new A<String>.named("Gaudeamus igitur")!?.[42];
- new A<String>.named("Gaudeamus igitur").getValue!;
- new A<String>.named("Gaudeamus igitur")[42]!;
- new A<String>.named("Gaudeamus igitur")!.s = "Lily was here";
- new A<String>.named("Gaudeamus igitur")!?.s = "Lily was here";
- new A<String>.named("Gaudeamus igitur")![0] = "Lily was here";
- new A<String>.named("Gaudeamus igitur")!?.[0] = "Lily was here";
- Expect.throws(() {new A<String>.named("Gaudeamus igitur").getNull!;});
- Expect.throws(() {new A<String>.named("Gaudeamus igitur")[null]!;});
+ new A<String>.named("Let's have fun")!;
+ new A<String>.named("Let's have fun")!.foo();
+ new A<String>.named("Let's have fun")![42];
+ new A<String>.named("Let's have fun")!?.foo();
+ new A<String>.named("Let's have fun")!?.[42];
+ new A<String>.named("Let's have fun").getValue!;
+ new A<String>.named("Let's have fun")[42]!;
+ new A<String>.named("Let's have fun")!.s = "Lily was here";
+ new A<String>.named("Let's have fun")!?.s = "Lily was here";
+ new A<String>.named("Let's have fun")![0] = "Lily was here";
+ new A<String>.named("Let's have fun")!?.[0] = "Lily was here";
+ Expect.throws(() {new A<String>.named("Let's have fun").getNull!;});
+ Expect.throws(() {new A<String>.named("Let's have fun")[null]!;});
}