Fixed Issue #465: New tests for Exports added (function typedefs).
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t09.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t09.dart
new file mode 100644
index 0000000..1922893
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t09.dart
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic typedef with nullable unused type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, it retains its status. Typedef is in the form [typedef
+ * <type> <identifier> <formalParameterPart>].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef expected = void Function();
+
+main() {
+ Expect.equals(expected, g_def1 );
+ Expect.equals(expected, g_nullable_object_def1 );
+ Expect.equals(expected, g_nullable_int_def1 );
+ Expect.equals(expected, g_nullable_function_def1);
+ Expect.equals(expected, g_null_def1 );
+ Expect.equals(expected, g_futureOr_def1 );
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t10.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t10.dart
new file mode 100644
index 0000000..f269165
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t10.dart
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic typedef with non-nullable unused type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, it retains its status. Typedef is in the form [typedef
+ * <type> <identifier> <formalParameterPart>].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef expected = void Function();
+
+main() {
+ Expect.equals(expected, g_object_def1 );
+ Expect.equals(expected, g_int_def1 );
+ Expect.equals(expected, g_function_def1);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t11.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t11.dart
new file mode 100644
index 0000000..36c3335
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t11.dart
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic typedef with [Never] unused type parameter
+ * is exported from opted-in library to legacy library and then back to the
+ * opted in code, it retains its status. Typedef is in the form [typedef <type>
+ * <identifier> <formalParameterPart>].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef expected = void Function();
+
+main() {
+ Expect.equals(expected, g_never_def1);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t12.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t12.dart
new file mode 100644
index 0000000..382a67e
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t12.dart
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef with nullable type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, typedef retains its status. Typedef is in the form
+ * [typedef <type> <identifier> <formalParameterPart>]. Check function with
+ * argument.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef exp_dynamic <T> = void Function(T);
+typedef exp_nullable_int <T extends int?> = void Function(T);
+typedef exp_nullable_object <T extends Object?> = void Function(T);
+typedef exp_nullable_function<T extends Function?> = void Function(T);
+typedef exp_null <T extends Null> = void Function(T);
+typedef exp_futureOr <T extends FutureOr> = void Function(T);
+
+main() {
+ Expect.equals(exp_nullable_int, g_def1_nullable_int_arg );
+ Expect.equals(exp_nullable_object, g_def1_nullable_object_arg );
+ Expect.equals(exp_dynamic, g_def1_dynamic_arg );
+ Expect.equals(exp_nullable_function, g_def1_nullable_function_arg);
+ Expect.equals(exp_null, g_def1_null_arg );
+ Expect.equals(exp_futureOr, g_def1_futureOr_arg );
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t13.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t13.dart
new file mode 100644
index 0000000..85cf387
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t13.dart
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef with non-nullable type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, typedef retains its status. Typedef is in the form
+ * [typedef <type> <identifier> <formalParameterPart>]. Check function with
+ * argument.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef exp_int <T> = void Function(T);
+typedef exp_object <T extends Object> = void Function(T);
+typedef exp_function<T extends Function> = void Function(T);
+
+main() {
+ Expect.equals(exp_int, g_def1_int_arg );
+ Expect.equals(exp_object, g_def1_object_arg );
+ Expect.equals(exp_function, g_def1_function_arg);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t14.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t14.dart
new file mode 100644
index 0000000..48bcf74
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t14.dart
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef [Never] type parameter is
+ * exported from opted-in library to legacy library and then back to the opted
+ * in code, typedef retains its status. Typedef is in the form [typedef <type>
+ * <identifier> <formalParameterPart>]. Check function with argument.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef expected = void Function(Never);
+
+main() {
+ Expect.equals(expected, g_def1_never_arg);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t15.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t15.dart
new file mode 100644
index 0000000..222b48a
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t15.dart
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef with nullable type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, typedef retains its status. Typedef is in the form
+ * [typedef <type> <identifier> <formalParameterPart>]. Check function with
+ * return value.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef exp_getDynamic <T> = T Function();
+typedef exp_getNullableInt <T extends int?> = T Function();
+typedef exp_getNullableObject <T extends Object?> = T Function();
+typedef exp_getNullableFunction<T extends Function?> = T Function();
+typedef exp_getNull <T extends Null> = T Function();
+typedef exp_getFutureOr <T extends FutureOr> = T Function();
+
+main() {
+ Expect.equals(exp_getNullableInt, g_def1_getNullableInt );
+ Expect.equals(exp_getNullableObject, g_def1_getNullableObject );
+ Expect.equals(exp_getDynamic, g_def1_getDynamic );
+ Expect.equals(exp_getNullableFunction, g_def1_getNullableFunction);
+ Expect.equals(exp_getNull, g_def1_getNull );
+ Expect.equals(exp_getFutureOr, g_def1_getFutureOr );
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t16.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t16.dart
new file mode 100644
index 0000000..aca46ec
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t16.dart
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef with non-nullable type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, typedef retains its status. Typedef is in the form
+ * [typedef <type> <identifier> <formalParameterPart>]. Check function with
+ * return value.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef exp_getInt <T extends int> = T Function();
+typedef exp_getObject <T extends Object> = T Function();
+typedef exp_getFunction<T extends Function> = T Function();
+
+main() {
+ Expect.equals(exp_getInt, g_def1_getInt );
+ Expect.equals(exp_getObject, g_def1_getObject );
+ Expect.equals(exp_getFunction, g_def1_getFunction);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef1_t17.dart b/LanguageFeatures/nnbd/exports_A01_typedef1_t17.dart
new file mode 100644
index 0000000..3b46978
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef1_t17.dart
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2020, 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 If an unmigrated library re-exports a migrated library, the
+ * re-exported symbols retain their migrated status (that is, downstream
+ * migrated libraries will see their migrated types).
+ * @description Check that if generic function typedef with [Never] type
+ * parameter is exported from opted-in library to legacy library and then back
+ * to the opted in code, typedef retains its status. Typedef is in the form
+ * [typedef <type> <identifier> <formalParameterPart>]. Check function with
+ * return value.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_lib.dart";
+
+typedef expected = Never Function();
+
+main() {
+ Expect.equals(expected, g_def1_getNever);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef_t10.dart b/LanguageFeatures/nnbd/exports_A01_typedef_t10.dart
index f225a99..94ceb52 100644
--- a/LanguageFeatures/nnbd/exports_A01_typedef_t10.dart
+++ b/LanguageFeatures/nnbd/exports_A01_typedef_t10.dart
@@ -22,7 +22,7 @@
typedef expected = void Function();
main() {
- Expect.equals(expected, g_object_def);
- Expect.equals(expected, g_int_def);
+ Expect.equals(expected, g_object_def );
+ Expect.equals(expected, g_int_def );
Expect.equals(expected, g_function_def);
}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef_t15.dart b/LanguageFeatures/nnbd/exports_A01_typedef_t15.dart
index c807c55..01d791e 100644
--- a/LanguageFeatures/nnbd/exports_A01_typedef_t15.dart
+++ b/LanguageFeatures/nnbd/exports_A01_typedef_t15.dart
@@ -29,10 +29,10 @@
typedef exp_getFutureOr <T extends FutureOr> = T Function();
main() {
- Expect.equals(exp_getNullableInt, g_def_getNullableInt);
- Expect.equals(exp_getNullableObject, g_def_getNullableObject);
- Expect.equals(exp_getDynamic, g_def_getDynamic);
+ Expect.equals(exp_getNullableInt, g_def_getNullableInt );
+ Expect.equals(exp_getNullableObject, g_def_getNullableObject );
+ Expect.equals(exp_getDynamic, g_def_getDynamic );
Expect.equals(exp_getNullableFunction, g_def_getNullableFunction);
- Expect.equals(exp_getNull, g_def_getNull);
- Expect.equals(exp_getFutureOr, g_def_getFutureOr);
+ Expect.equals(exp_getNull, g_def_getNull );
+ Expect.equals(exp_getFutureOr, g_def_getFutureOr );
}
diff --git a/LanguageFeatures/nnbd/exports_opted_in_lib.dart b/LanguageFeatures/nnbd/exports_opted_in_lib.dart
index 468d8eb..c51d462 100644
--- a/LanguageFeatures/nnbd/exports_opted_in_lib.dart
+++ b/LanguageFeatures/nnbd/exports_opted_in_lib.dart
@@ -224,3 +224,45 @@
typedef FutureOr<int> def1_getFutureOrInt();
typedef Never def1_getNever();
+
+// Generic Function typedefs like
+// [typedef <type> <identifier> <formalParameterPart>].
+
+typedef g_def1 <T> = void Function();
+typedef g_nullable_int_def1 <T extends int?> = void Function();
+typedef g_nullable_object_def1 <T extends Object?> = void Function();
+typedef g_nullable_function_def1<T extends Function?> = void Function();
+typedef g_null_def1 <T extends Null> = void Function();
+typedef g_futureOr_def1 <T extends FutureOr> = void Function();
+
+typedef g_int_def1 <T extends int> = void Function();
+typedef g_object_def1 <T extends Object> = void Function();
+typedef g_function_def1<T extends Function> = void Function();
+
+typedef g_never_def1<T extends Never> = void Function();
+
+typedef g_def1_dynamic_arg <T> = void Function(T);
+typedef g_def1_nullable_int_arg <T extends int?> = void Function(T);
+typedef g_def1_nullable_object_arg <T extends Object?> = void Function(T);
+typedef g_def1_nullable_function_arg<T extends Function?> = void Function(T);
+typedef g_def1_null_arg <T extends Null> = void Function(T);
+typedef g_def1_futureOr_arg <T extends FutureOr> = void Function(T);
+
+typedef g_def1_int_arg <T> = void Function(T);
+typedef g_def1_object_arg <T extends Object> = void Function(T);
+typedef g_def1_function_arg<T extends Function> = void Function(T);
+
+typedef g_def1_never_arg<T extends Never> = void Function(T);
+
+typedef g_def1_getDynamic <T> = T Function();
+typedef g_def1_getNullableInt <T extends int?> = T Function();
+typedef g_def1_getNullableObject <T extends Object?> = T Function();
+typedef g_def1_getNullableFunction<T extends Function?> = T Function();
+typedef g_def1_getNull <T extends Null> = T Function();
+typedef g_def1_getFutureOr <T extends FutureOr> = T Function();
+
+typedef g_def1_getInt <T extends int> = T Function();
+typedef g_def1_getObject <T extends Object> = T Function();
+typedef g_def1_getFunction<T extends Function> = T Function();
+
+typedef g_def1_getNever<T extends Never> = T Function();