Fixed Issue #465: New tests for Exports added (type aliases).
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t01.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t01.dart
new file mode 100644
index 0000000..4dde4cf
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t01.dart
@@ -0,0 +1,39 @@
+/*
+ * 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 nullable type alias exported from opted-in library to
+ * legacy library and then back to the opted in code retains its status.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// Requirements=nnbd-strong
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+typedef exp_A                                              = A?         ;
+typedef exp_Int                                            = int?       ;
+typedef exp_Function                                       = Function?  ;
+typedef exp_Object                                         = Object?    ;
+typedef exp_Dynamic                                        = dynamic    ;
+typedef exp_Null                                           = Null       ;
+typedef exp_FutureOr                                       = FutureOr   ;
+typedef exp_FutureOrFutureOr<T extends FutureOr<FutureOr>> = FutureOr<T>;
+
+main() {
+  Expect.equals(typeOf<exp_A>(),                typeOf<NullableAAlias>()       );
+  Expect.equals(typeOf<exp_Int>(),              typeOf<NullableIntAlias>()     );
+  Expect.equals(typeOf<exp_Function>(),         typeOf<NullableFunctionAlias>());
+  Expect.equals(typeOf<exp_Object>(),           typeOf<NullableObjectAlias>()  );
+  Expect.equals(typeOf<exp_Dynamic>(),          typeOf<DynamicAlias>()         );
+  Expect.equals(typeOf<exp_Null>(),             typeOf<NullAlias>()            );
+  Expect.equals(typeOf<exp_FutureOr>(),         typeOf<FutureOrAlias>()        );
+  Expect.equals(typeOf<exp_FutureOrFutureOr>(), typeOf<FutureOrFutureOrAlias>());
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t02.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t02.dart
new file mode 100644
index 0000000..c3e1ecf
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t02.dart
@@ -0,0 +1,39 @@
+/*
+ * 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 nullable type alias exported from opted-in library
+ * to legacy library and then back to the opted in code, its variable can be
+ * assigned to non-null object.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+void testme() {}
+
+main() {
+  NullableAAlias        a = A()   ;
+  NullableIntAlias      i = 0     ;
+  NullableFunctionAlias f = testme;
+  NullableObjectAlias   o = 1     ;
+  DynamicAlias          d = "Hi!" ;
+  FutureOrAlias         x = 4     ;
+  FutureOrFutureOrAlias y = 5     ;
+
+  Expect.isNotNull(a);
+  Expect.isNotNull(i);
+  Expect.isNotNull(f);
+  Expect.isNotNull(o);
+  Expect.isNotNull(d);
+  Expect.isNotNull(x);
+  Expect.isNotNull(y);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t03.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t03.dart
new file mode 100644
index 0000000..958a8ca
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t03.dart
@@ -0,0 +1,39 @@
+/*
+ * 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 nullable type alias exported from opted-in library
+ * to legacy library and then back to the opted in code, its variable can be
+ * assigned to [null].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+main() {
+  NullableAAlias        a = null;
+  NullableIntAlias      i = null;
+  NullableFunctionAlias f = null;
+  NullableObjectAlias   o = null;
+  DynamicAlias          d = null;
+  NullAlias             n = null;
+  FutureOrAlias         x = null;
+  FutureOrFutureOrAlias y = null;
+
+  Expect.isNull(a);
+  Expect.isNull(i);
+  Expect.isNull(f);
+  Expect.isNull(o);
+  Expect.isNull(d);
+  Expect.isNull(x);
+  Expect.isNull(y);
+  Expect.isNull(n);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t04.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t04.dart
new file mode 100644
index 0000000..a70bb06
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t04.dart
@@ -0,0 +1,35 @@
+/*
+ * 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 non-nullable type alias exported from opted-in
+ * library to legacy library and then back to the opted in code retains its
+ * status.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+typedef exp_A                          = A          ;
+typedef exp_Int                        = int        ;
+typedef exp_Object                     = Object     ;
+typedef exp_Function                   = Function   ;
+typedef exp_FutureOrInt<T extends int> = FutureOr<T>;
+
+
+main() {
+  Expect.equals(typeOf<exp_A>()          , typeOf<AAlias>()          );
+  Expect.equals(typeOf<exp_Int>()        , typeOf<IntAlias>()        );
+  Expect.equals(typeOf<exp_Function>()   , typeOf<FunctionAlias>()   );
+  Expect.equals(typeOf<exp_Object>()     , typeOf<ObjectAlias>()     );
+  Expect.equals(typeOf<exp_FutureOrInt>(), typeOf<FutureOrIntAlias>());
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t05.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t05.dart
new file mode 100644
index 0000000..a5e8b83
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t05.dart
@@ -0,0 +1,35 @@
+/*
+ * 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 non-nullable type alias exported from opted-in
+ * library to legacy library and then back to the opted in code, its variable
+ * can be assigned to non-null object.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+void testme() {}
+
+main() {
+  AAlias           a = A()   ;
+  IntAlias         i = 0     ;
+  FunctionAlias    f = testme;
+  ObjectAlias      o = 1     ;
+  FutureOrIntAlias x = 4     ;
+
+  Expect.isNotNull(a);
+  Expect.isNotNull(i);
+  Expect.isNotNull(f);
+  Expect.isNotNull(o);
+  Expect.isNotNull(x);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t06.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t06.dart
new file mode 100644
index 0000000..7832ea5
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t06.dart
@@ -0,0 +1,45 @@
+/*
+ * 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 non-nullable type alias exported from opted-in
+ * library to legacy library and then back to the opted in code, its variable
+ * cannot be assigned to [null].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "exports_legacy_A01_aliases_lib.dart";
+
+main() {
+  AAlias a = null;
+//           ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  IntAlias i = null;
+//             ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  FunctionAlias f = null;
+//                  ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  ObjectAlias o = null;
+//                ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  FutureOrIntAlias x = null;
+//                     ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t07.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t07.dart
new file mode 100644
index 0000000..c6b7200
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t07.dart
@@ -0,0 +1,23 @@
+/*
+ * 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 type alias for [Never] type is exported from
+ * opted-in library to legacy library and then back to the opted in code, it
+ * retains its status.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "../../Utils/expect.dart";
+import "exports_legacy_A01_aliases_lib.dart";
+
+main() {
+  Expect.equals(Never, NeverAlias);
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t08.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t08.dart
new file mode 100644
index 0000000..ff03f7c
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t08.dart
@@ -0,0 +1,35 @@
+/*
+ * 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 type alias for [Never] type exported from opted-
+ * in library to legacy library and then back to the opted in code cannot be
+ * assigned to any object.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "exports_legacy_A01_aliases_lib.dart";
+
+main() {
+  NeverAlias n1 = 1;
+//                ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  NeverAlias n2 = "Should not reach jere";
+//                ^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  NeverAlias n3 = A();
+//                ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/nnbd/exports_A01_typedef2_t09.dart b/LanguageFeatures/nnbd/exports_A01_typedef2_t09.dart
new file mode 100644
index 0000000..b6a6066
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_A01_typedef2_t09.dart
@@ -0,0 +1,25 @@
+/*
+ * 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 type alias for [Never] type exported from opted-
+ * in library to legacy library and then back to the opted in code cannot be
+ * assigned to [null].
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+import "exports_legacy_A01_aliases_lib.dart";
+
+main() {
+  NeverAlias n = null;
+//               ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/nnbd/exports_legacy_A01_aliases_lib.dart b/LanguageFeatures/nnbd/exports_legacy_A01_aliases_lib.dart
new file mode 100644
index 0000000..989b4bf
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_legacy_A01_aliases_lib.dart
@@ -0,0 +1,15 @@
+/*
+ * 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.
+ */
+/**
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+library export_opted_aliases_lib;
+export "exports_opted_in_aliases_lib.dart";
+
+
diff --git a/LanguageFeatures/nnbd/exports_opted_in_aliases_lib.dart b/LanguageFeatures/nnbd/exports_opted_in_aliases_lib.dart
new file mode 100644
index 0000000..3a319ea
--- /dev/null
+++ b/LanguageFeatures/nnbd/exports_opted_in_aliases_lib.dart
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+/**
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
+// Requirements=nnbd-strong
+
+library override_opted_in_lib;
+
+import "dart:async";
+
+class A {}
+
+// Nullable type aliases:
+typedef NullableAAlias                                      = A?;
+typedef NullableIntAlias                                    = int?;
+typedef NullableFunctionAlias                               = Function?;
+typedef NullableObjectAlias                                 = Object?;
+typedef DynamicAlias                                        = dynamic;
+typedef NullAlias                                           = Null;
+typedef FutureOrAlias                                       = FutureOr;
+typedef FutureOrFutureOrAlias<T extends FutureOr<FutureOr>> = FutureOr<T>;
+
+// Non-nullable type aliases:
+typedef AAlias                          = A;
+typedef IntAlias                        = int;
+typedef ObjectAlias                     = Object;
+typedef FunctionAlias                   = Function;
+typedef FutureOrIntAlias<T extends int> = FutureOr<T>;
+
+// Never aliases:
+typedef NeverAlias = Never;