Version 2.15.0-108.0.dev

Merge commit 'f4919c0a6cc3837217ffdd4deea6d29c2f4c4cfa' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0fed6d6..1df0081 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2168,7 +2168,7 @@
   throws in dart2js if the API is used directly without manually setting up a
   `defaultPackagesBase` hook.
 
-[1]: https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#200---2018-08-07
+[1]: https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md#200---2018-08-07
 
 #### `dart:developer`
 
@@ -3783,7 +3783,7 @@
 
 - Dart `int` is now restricted to 64 bits. On overflow, arithmetic operations
   wrap around, and integer literals larger than 64 bits are not allowed. See
-  https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md
+  https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md
   for details.
 
 - The Dart VM no longer attempts to perform `packages/` directory resolution
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bf9f47d..6802814 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -26,7 +26,7 @@
 
 ## Getting the code
 
-To work with the Dart code, you need to download and build the development branch. Active development of Dart takes place on the `master` branch, from which we push "green" versions that have passed all tests to `dev` branch. Complete instructions are found at [Getting The Source](https://github.com/dart-lang/sdk/wiki/Building#getting-the-source)
+To work with the Dart code, you need to download and build the development branch. Active development of Dart takes place on the `main` branch, from which we push "green" versions that have passed all tests to `dev` branch. Complete instructions are found at [Getting The Source](https://github.com/dart-lang/sdk/wiki/Building#getting-the-source)
 
 ## Starting a patch with git
 
@@ -56,7 +56,7 @@
 Note: you can run this command from any branch.
 
 This command will fetch
-origin/main, rebase all your open branches, and delete
+`origin/main`, rebase all your open branches, and delete
 cleanly merged branches.
 
 Your local workflow may vary.
diff --git a/DEPS b/DEPS
index 239e999..bfc2f1c 100644
--- a/DEPS
+++ b/DEPS
@@ -163,7 +163,7 @@
   "test_reflective_loader_rev": "fcfce37666672edac849d2af6dffc0f8df236a94",
   "test_rev": "099dcc4d052a30c6921489cfbefa1c8531d12975",
   "typed_data_rev": "29ce5a92b03326d0b8035916ac04f528874994bd",
-  "usage_rev": "016dd302b494e4ff70a7850957ec895eced9d220",
+  "usage_rev": "e0780cd8b2f8af69a28dc52678ffe8492da27d06",
   "vector_math_rev": "0c9f5d68c047813a6dcdeb88ba7a42daddf25025",
   "watcher_rev": "3924194385fb215cef483193ed2879a618a3d69c",
   "webdriver_rev": "ff5ccb1522edf4bed578ead4d65e0cbc1f2c4f02",
diff --git a/docs/language/informal/covariant-from-class.md b/docs/language/informal/covariant-from-class.md
index 06d54bf..604b37d 100644
--- a/docs/language/informal/covariant-from-class.md
+++ b/docs/language/informal/covariant-from-class.md
@@ -80,7 +80,7 @@
 However, covariant parameter types can be quite natural and convenient,
 they just impose an obligation on developers to use ad-hoc reasoning in
 order to avoid the potential type errors at run time. The
-[covariant overrides](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/covariant-overrides.md)
+[covariant overrides](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/covariant-overrides.md)
 feature was added exactly for this purpose: When developers want to use
 unsound covariance, they can get it by requesting it explicitly. In the
 (vast majority of) cases where the sound and more strict contravariant rule
@@ -252,7 +252,7 @@
 
 When we say that a parameter is **covariant by modifier**, we are referring
 to the definition of being a covariant parameter which is given in
-[covariant overrides](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/covariant-overrides.md).
+[covariant overrides](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/covariant-overrides.md).
 
 *When a parameter _p_ is covariant by modifier, there will necessarily be a
 declaration of a formal parameter _p1_ (which may be the same as _p_, or it
diff --git a/docs/language/informal/generic-function-instantiation.md b/docs/language/informal/generic-function-instantiation.md
index 80e9241..254d1e0 100644
--- a/docs/language/informal/generic-function-instantiation.md
+++ b/docs/language/informal/generic-function-instantiation.md
@@ -37,7 +37,7 @@
 ## Motivation
 
 The
-[language specification](https://github.com/dart-lang/sdk/blob/master/docs/language/dartLangSpec.tex)
+[language specification](https://github.com/dart-lang/sdk/blob/main/docs/language/dartLangSpec.tex)
 uses the phrase _function object_ to denote the first-class semantic
 entity which corresponds to a function declaration. In the following
 example, each of the expressions `fg`, `A.fs`, `new A().fi`, and `fl` in
diff --git a/docs/language/informal/implicit-creation.md b/docs/language/informal/implicit-creation.md
index 903ff40..2c98362 100644
--- a/docs/language/informal/implicit-creation.md
+++ b/docs/language/informal/implicit-creation.md
@@ -11,7 +11,7 @@
 reserved words `new` and `const` in instance creation expressions.
 
 This feature specification was written with a
-[combined proposal](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md)
+[combined proposal](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new-const.md)
 as the starting point. That proposal presents optional new and optional const
 together with several other features.
 
@@ -303,5 +303,5 @@
 
 - 0.1 (2017-08-15) Stand-alone informal specification for optional new created,
   using version 0.8 of the combined proposal
-  [optional-new-const.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md)
+  [optional-new-const.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new-const.md)
   as the starting point.
diff --git a/docs/language/informal/instantiate-to-bound.md b/docs/language/informal/instantiate-to-bound.md
index dafcf2d..e831fb2 100644
--- a/docs/language/informal/instantiate-to-bound.md
+++ b/docs/language/informal/instantiate-to-bound.md
@@ -275,7 +275,7 @@
 when that number reaches zero.*
 
 *Note that this process may produce a
-[super-bounded type](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md).*
+[super-bounded type](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md).*
 
 *It may seem somewhat arbitrary to treat unused and invariant parameters
 the same as covariant parameters. In particular, we could easily have made
@@ -386,7 +386,7 @@
     there.
 
 *   Sep 15th 2017: Transferred to the SDK repository as
-    [instantiate-to-bound.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
+    [instantiate-to-bound.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).
 
 *   Sep 15th 2017: Adjusted to include the enhanced expressive power
     described in
diff --git a/docs/language/informal/interface-conflicts.md b/docs/language/informal/interface-conflicts.md
index ebc21f2..3ce7d64 100644
--- a/docs/language/informal/interface-conflicts.md
+++ b/docs/language/informal/interface-conflicts.md
@@ -79,7 +79,7 @@
 
 This means that we will express the complete rules for being 'more
 interface-specific than' as a slight modification of
-[subtyping.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/subtyping.md)
+[subtyping.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/subtyping.md)
 and in particular, the rule 'Right Top' will need to be split in cases
 such that `Object` and `dynamic` are more interface-specific than `void` and
 mutually unrelated, and all other types are more interface-specific than
@@ -109,7 +109,7 @@
 explicitly.
 
 *They might be obtained via
-[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md)
+[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md)
 or, in case such a mechanism is introduced, they might be inferred.*
 
 *The language specification already contains verbiage to this effect, but we
diff --git a/docs/language/informal/optional-new-const.md b/docs/language/informal/optional-new-const.md
index e249a63..a0b87bc 100644
--- a/docs/language/informal/optional-new-const.md
+++ b/docs/language/informal/optional-new-const.md
@@ -5,7 +5,7 @@
 **Version**: 0.8 (2017-06-20)
 
 **Status**: This is background material for
-[implicit-creation.md](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/implicit-creation.md).
+[implicit-creation.md](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/implicit-creation.md).
 
 This informal specification documents a group of four related features.
 * Optional `const`
diff --git a/docs/language/informal/super-bounded-types.md b/docs/language/informal/super-bounded-types.md
index 6ecb027..316af1c 100644
--- a/docs/language/informal/super-bounded-types.md
+++ b/docs/language/informal/super-bounded-types.md
@@ -108,7 +108,7 @@
 greatest possible amount of information about the set of objects whose type
 is on the form `C<T>` for some `T`. In particular, we cannot express the
 type which "should be" the result of
-[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md)
+[instantiate-to-bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md)
 on the raw type `C`.
 
 We can make an attempt to approximate the least supertype of all correct
diff --git a/docs/process/language-versions-and-experiments.md b/docs/process/language-versions-and-experiments.md
index 54f83ad..54147ca 100644
--- a/docs/process/language-versions-and-experiments.md
+++ b/docs/process/language-versions-and-experiments.md
@@ -284,7 +284,7 @@
 That's it. Now you have a library that Dart tools know targets 2.8+non-nullable,
 at least today.
 
-[experimental flags doc]: https://github.com/dart-lang/sdk/blob/master/docs/process/experimental-flags.md
+[experimental flags doc]: https://github.com/dart-lang/sdk/blob/main/docs/process/experimental-flags.md
 
 ### 2.8.0 ships without null safety
 
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index d2b2f22..1185171 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -963,7 +963,7 @@
   test(name, body);
 }
 ```
-  When subscribed to [notifications for outlines of a test file](https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html#notification_analysis.outline),
+  When subscribed to [notifications for outlines of a test file](https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/doc/api.html#notification_analysis.outline),
   they will include elements for UNIT_TEST_GROUP and UNIT_TEST_TEST.
 * Improve guess for type name identifier. (#32765)
 * Fix LineInfo.getOffsetOfLineAfter().
diff --git a/pkg/analyzer_plugin/README.md b/pkg/analyzer_plugin/README.md
index 0644f0b..55fa2fa 100644
--- a/pkg/analyzer_plugin/README.md
+++ b/pkg/analyzer_plugin/README.md
@@ -28,7 +28,7 @@
 See the [LICENSE] file.
 
 [issues]: https://github.com/dart-lang/sdk/issues
-[LICENSE]: https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/LICENSE
+[LICENSE]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/LICENSE
 [list]: https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss
-[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/api.html
-[tutorial]: https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/tutorial/tutorial.md
+[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/api.html
+[tutorial]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/tutorial/tutorial.md
diff --git a/pkg/analyzer_plugin/doc/tutorial/introduction.md b/pkg/analyzer_plugin/doc/tutorial/introduction.md
index 033031a..dc55139 100644
--- a/pkg/analyzer_plugin/doc/tutorial/introduction.md
+++ b/pkg/analyzer_plugin/doc/tutorial/introduction.md
@@ -215,4 +215,4 @@
 [completion]: completion.md
 [fixes]: fixes.md
 [navigation]: navigation.md
-[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_plugin/doc/api.html
+[pluginapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analyzer_plugin/doc/api.html
diff --git a/pkg/dds/README.md b/pkg/dds/README.md
index ec3567b..ef1be7d 100644
--- a/pkg/dds/README.md
+++ b/pkg/dds/README.md
@@ -33,4 +33,4 @@
 ```
 
 [dds-protocol]: dds_protocol.md
-[service-protocol]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md
+[service-protocol]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md
diff --git a/pkg/dds/dds_protocol.md b/pkg/dds/dds_protocol.md
index 48ac4c1..6563543 100644
--- a/pkg/dds/dds_protocol.md
+++ b/pkg/dds/dds_protocol.md
@@ -282,17 +282,17 @@
 1.2 | Added `getStreamHistory` RPC.
 1.3 | Added `getAvailableCachedCpuSamples` and `getCachedCpuSamples` RPCs.
 
-[resume]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#resume
-[success]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#success
-[version]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#version
-[cpu-samples]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#cpusamples
+[resume]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#resume
+[success]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#success
+[version]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#version
+[cpu-samples]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#cpusamples
 
-[service-protocol]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md
-[service-protocol-rpcs-requests-and-responses]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#rpcs-requests-and-responses
-[service-protocol-events]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#events
-[service-protocol-streams]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#streamlisten
-[service-protocol-binary-events]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#binary-events
-[service-protocol-types]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#types
-[service-protocol-ids-and-names]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#ids-and-names
-[service-protocol-public-rpcs]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#public-rpcs
-[service-protocol-public-types]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#public-types
+[service-protocol]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md
+[service-protocol-rpcs-requests-and-responses]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#rpcs-requests-and-responses
+[service-protocol-events]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#events
+[service-protocol-streams]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#streamlisten
+[service-protocol-binary-events]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#binary-events
+[service-protocol-types]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#types
+[service-protocol-ids-and-names]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#ids-and-names
+[service-protocol-public-rpcs]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#public-rpcs
+[service-protocol-public-types]: https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#public-types
diff --git a/pkg/dev_compiler/doc/STATIC_SAFETY.md b/pkg/dev_compiler/doc/STATIC_SAFETY.md
index 9201c33..4710af4 100644
--- a/pkg/dev_compiler/doc/STATIC_SAFETY.md
+++ b/pkg/dev_compiler/doc/STATIC_SAFETY.md
@@ -370,7 +370,7 @@
 
 Strong mode effectively treats all standard Dart static warnings as static errors.  Most of these warnings are required for soundness (e.g., if a concrete class is missing methods required by a declared interface).  A full list of Dart static warnings may found in the [Dart specification][dartspec], or enumerated here:
 
-[https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/generated/error.dart#L3772](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fdart-lang%2Fsdk%2Fblob%2Fmaster%2Fpkg%2Fanalyzer%2Flib%2Fsrc%2Fgenerated%2Ferror.dart%23L3772&sa=D&sntz=1&usg=AFQjCNFc4E37M1PshVcw4zk7C9jXgqfGbw)
+[https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/lib/src/generated/error.dart#L3772](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fdart-lang%2Fsdk%2Fblob%2Fmaster%2Fpkg%2Fanalyzer%2Flib%2Fsrc%2Fgenerated%2Ferror.dart%23L3772&sa=D&sntz=1&usg=AFQjCNFc4E37M1PshVcw4zk7C9jXgqfGbw)
 
 ### Super Invocations
 
diff --git a/pkg/diagnostic/README.md b/pkg/diagnostic/README.md
index c71c3a7..4c5ddfa 100644
--- a/pkg/diagnostic/README.md
+++ b/pkg/diagnostic/README.md
@@ -11,4 +11,4 @@
 
 See the [LICENSE] file.
 
-[LICENSE]: https://github.com/dart-lang/sdk/blob/master/pkg/diagnostic/LICENSE
+[LICENSE]: https://github.com/dart-lang/sdk/blob/main/pkg/diagnostic/LICENSE
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index ddbe0bb..8ffe91a 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -1067,6 +1067,17 @@
         export.exporter.addProblem(
             messagePartExport, export.charOffset, "export".length, null,
             context: context);
+        if (library != null) {
+          // Recovery: Export the main library instead.
+          export.exported = library;
+          SourceLibraryBuilder exporter =
+              export.exporter as SourceLibraryBuilder;
+          for (Export export2 in exporter.exports) {
+            if (export2.exported == this) {
+              export2.exported = library;
+            }
+          }
+        }
       }
     }
   }
@@ -1228,6 +1239,12 @@
       part.scope.becomePartOf(scope);
       // TODO(ahe): Include metadata from part?
 
+      // Recovery: Take on all exporters (i.e. if a library has erroneously
+      // exported the part it has (in validatePart) been recovered to import the
+      // main library (this) instead --- to make it complete (and set up scopes
+      // correctly) the exporters in this has to be updated too).
+      exporters.addAll(part.exporters);
+
       nativeMethods.addAll(part.nativeMethods);
       boundlessTypeVariables.addAll(part.boundlessTypeVariables);
       // Check that the targets are different. This is not normally a problem
@@ -1245,6 +1262,11 @@
           _implicitlyTypedFields!.addAll(partImplicitlyTypedFields);
         }
       }
+      if (library != part.library) {
+        // Mark the part library as synthetic as it's not an actual library
+        // (anymore).
+        part.library.isSynthetic = true;
+      }
       return true;
     } else {
       assert(part is DillLibraryBuilder);
@@ -1273,15 +1295,21 @@
   void addImportsToScope() {
     bool explicitCoreImport = this == loader.coreLibrary;
     for (Import import in imports) {
-      if (import.imported == loader.coreLibrary) {
-        explicitCoreImport = true;
-      }
       if (import.imported?.isPart ?? false) {
         addProblem(
             templatePartOfInLibrary.withArguments(import.imported!.fileUri),
             import.charOffset,
             noLength,
             fileUri);
+        if (import.imported?.partOfLibrary != null) {
+          // Recovery: Rewrite to import the "part owner" library.
+          // Note that the part will not have a partOfLibrary if it claims to be
+          // a part, but isn't mentioned as a part by the (would-be) "parent".
+          import.imported = import.imported?.partOfLibrary;
+        }
+      }
+      if (import.imported == loader.coreLibrary) {
+        explicitCoreImport = true;
       }
       import.finalizeImports(this);
     }
diff --git a/pkg/front_end/testcases/incremental/regress_46706.yaml b/pkg/front_end/testcases/incremental/regress_46706.yaml
new file mode 100644
index 0000000..3d5be72
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706.yaml
@@ -0,0 +1,38 @@
+# Copyright (c) 2021, 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.md file.
+
+type: newworld
+worlds:
+  - entry: main.dart
+    errors: true
+    sources:
+      main.dart: |
+        import 'lib.dart';
+        part 'part.dart';
+        void main() {}
+      part.dart: |
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        import 'part.dart';
+        import 'part.dart';
+        import 'part.dart';
+        void libMethod() {
+          partMethod();
+        }
+    expectedLibraryCount: 2
+  - entry: main.dart
+    invalidate:
+      - lib.dart
+    sources:
+      main.dart: |
+        import 'lib.dart';
+        part 'part.dart';
+        void main() {}
+      part.dart: |
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        void libMethod() {}
+    expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/regress_46706.yaml.world.1.expect b/pkg/front_end/testcases/incremental/regress_46706.yaml.world.1.expect
new file mode 100644
index 0000000..9d57f2f
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706.yaml.world.1.expect
@@ -0,0 +1,37 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+//
+// Problems in library:
+//
+// org-dartlang-test:///lib.dart:1:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+// org-dartlang-test:///lib.dart:2:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+// org-dartlang-test:///lib.dart:3:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+
+  import "org-dartlang-test:///main.dart";
+  import "org-dartlang-test:///main.dart";
+  import "org-dartlang-test:///main.dart";
+
+  static method libMethod() → void {
+    main::partMethod();
+  }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart";
+
+  part part.dart;
+  static method main() → void {}
+  static method /* from org-dartlang-test:///part.dart */ partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706.yaml.world.2.expect b/pkg/front_end/testcases/incremental/regress_46706.yaml.world.2.expect
new file mode 100644
index 0000000..0c51b9c
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706.yaml.world.2.expect
@@ -0,0 +1,13 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+  static method libMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart";
+
+  part part.dart;
+  static method main() → void {}
+  static method /* from org-dartlang-test:///part.dart */ partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime.yaml b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml
new file mode 100644
index 0000000..80c029a
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml
@@ -0,0 +1,41 @@
+# Copyright (c) 2021, 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.md file.
+
+type: newworld
+worlds:
+  - entry: main.dart
+    errors: true
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        part 'part.dart';
+        void main() {
+          lib.partMethod();
+        }
+      part.dart: |
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        export 'part.dart';
+        export 'part.dart';
+        export 'part.dart';
+        void libMethod() {}
+    expectedLibraryCount: 2
+  - entry: main.dart
+    invalidate:
+      - lib.dart
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        part 'part.dart';
+        void main() {
+          lib.partMethod();
+        }
+      part.dart: |
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        void libMethod() {}
+        void partMethod() {}
+    expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.1.expect b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.1.expect
new file mode 100644
index 0000000..b971e1b
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.1.expect
@@ -0,0 +1,39 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+//
+// Problems in library:
+//
+// org-dartlang-test:///lib.dart:1:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+// org-dartlang-test:///lib.dart:2:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+// org-dartlang-test:///lib.dart:3:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+additionalExports = (main::main,
+  main::partMethod)
+
+  export "org-dartlang-test:///main.dart";
+  export "org-dartlang-test:///main.dart";
+  export "org-dartlang-test:///main.dart";
+
+  static method libMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  part part.dart;
+  static method main() → void {
+    main::partMethod();
+  }
+  static method /* from org-dartlang-test:///part.dart */ partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.2.expect b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.2.expect
new file mode 100644
index 0000000..fafd095
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime.yaml.world.2.expect
@@ -0,0 +1,16 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+  static method libMethod() → void {}
+  static method partMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  part part.dart;
+  static method main() → void {
+    lib::partMethod();
+  }
+  static method /* from org-dartlang-test:///part.dart */ partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml
new file mode 100644
index 0000000..868016e
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml
@@ -0,0 +1,32 @@
+# Copyright (c) 2021, 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.md file.
+
+type: newworld
+worlds:
+  - entry: main.dart
+    errors: true
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        void main() {}
+      part.dart: |
+        // Notice that main.dart didn't claim this as a part!
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        import 'part.dart';
+        import 'part.dart';
+        import 'part.dart';
+        void libMethod() {}
+    expectedLibraryCount: 3
+  - entry: main.dart
+    invalidate:
+      - lib.dart
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        void main() {}
+      lib.dart: |
+        void libMethod() {}
+    expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.1.expect b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.1.expect
new file mode 100644
index 0000000..bf95242
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.1.expect
@@ -0,0 +1,45 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+//
+// Problems in library:
+//
+// org-dartlang-test:///lib.dart:1:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+// org-dartlang-test:///lib.dart:2:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+// org-dartlang-test:///lib.dart:3:1: Error: Can't import 'org-dartlang-test:///part.dart', because it has a 'part of' declaration.
+// Try removing the 'part of' declaration, or using 'org-dartlang-test:///part.dart' as a part.
+// import 'part.dart';
+// ^
+//
+
+  import "org-dartlang-test:///part.dart";
+  import "org-dartlang-test:///part.dart";
+  import "org-dartlang-test:///part.dart";
+
+  static method libMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  static method main() → void {}
+}
+library from "org-dartlang-test:///part.dart" as part {
+//
+// Problems in library:
+//
+// org-dartlang-test:///part.dart:1:1: Error: This part doesn't have a containing library.
+// Try removing the 'part of' declaration.
+// // Notice that main.dart didn't claim this as a part!
+// ^
+//
+
+  static method partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.2.expect b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.2.expect
new file mode 100644
index 0000000..b4dd167
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_2.yaml.world.2.expect
@@ -0,0 +1,11 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+  static method libMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  static method main() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml
new file mode 100644
index 0000000..9bf8612
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml
@@ -0,0 +1,37 @@
+# Copyright (c) 2021, 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.md file.
+
+type: newworld
+worlds:
+  - entry: main.dart
+    errors: true
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        void main() {
+          lib.partMethod();
+        }
+      part.dart: |
+        // Notice that main.dart didn't claim this as a part!
+        part of "main.dart";
+        void partMethod() {}
+      lib.dart: |
+        export 'part.dart';
+        export 'part.dart';
+        export 'part.dart';
+        void libMethod() {}
+    expectedLibraryCount: 3
+  - entry: main.dart
+    invalidate:
+      - lib.dart
+    sources:
+      main.dart: |
+        import 'lib.dart' as lib;
+        void main() {
+          lib.partMethod();
+        }
+      lib.dart: |
+        void libMethod() {}
+        void partMethod() {}
+    expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.1.expect b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.1.expect
new file mode 100644
index 0000000..c2db276
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.1.expect
@@ -0,0 +1,48 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+//
+// Problems in library:
+//
+// org-dartlang-test:///lib.dart:1:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+// org-dartlang-test:///lib.dart:2:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+// org-dartlang-test:///lib.dart:3:1: Error: Can't export this file because it contains a 'part of' declaration.
+// export 'part.dart';
+// ^^^^^^
+// org-dartlang-test:///part.dart: Context: This is the file that can't be exported.
+//
+additionalExports = (part::partMethod)
+
+  export "org-dartlang-test:///part.dart";
+  export "org-dartlang-test:///part.dart";
+  export "org-dartlang-test:///part.dart";
+
+  static method libMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  static method main() → void {
+    part::partMethod();
+  }
+}
+library from "org-dartlang-test:///part.dart" as part {
+//
+// Problems in library:
+//
+// org-dartlang-test:///part.dart:1:1: Error: This part doesn't have a containing library.
+// Try removing the 'part of' declaration.
+// // Notice that main.dart didn't claim this as a part!
+// ^
+//
+
+  static method partMethod() → void {}
+}
diff --git a/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.2.expect b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.2.expect
new file mode 100644
index 0000000..7818b5b
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/regress_46706_prime_3.yaml.world.2.expect
@@ -0,0 +1,14 @@
+main = main::main;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+  static method libMethod() → void {}
+  static method partMethod() → void {}
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+  import "org-dartlang-test:///lib.dart" as lib;
+
+  static method main() → void {
+    lib::partMethod();
+  }
+}
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index 31281ff..b0de73c 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -1126,7 +1126,7 @@
     writeOffset(node.fileOffset);
     writeByte(node.flags);
     writeAnnotationList(node.annotations);
-    writeLibraryReference(node.targetLibrary, allowNull: true);
+    writeLibraryReference(node.targetLibrary, allowNull: false);
     writeStringReference(node.name ?? '');
     writeNodeList(node.combinators);
   }
diff --git a/pkg/vm_service/README.md b/pkg/vm_service/README.md
index 11194fd..6c47181 100644
--- a/pkg/vm_service/README.md
+++ b/pkg/vm_service/README.md
@@ -7,11 +7,11 @@
 ## Usage
 
 See the
-[example](https://github.com/dart-lang/sdk/blob/master/pkg/vm_service/example/vm_service_tester.dart)
+[example](https://github.com/dart-lang/sdk/blob/main/pkg/vm_service/example/vm_service_tester.dart)
 for a simple use of the library's API.
 
 The VM Service Protocol spec can be found at
-[github.com/dart-lang/sdk/runtime/vm/service/service.md](https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md).
+[github.com/dart-lang/sdk/runtime/vm/service/service.md](https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md).
 
 ## Features and bugs
 
diff --git a/runtime/docs/gc.md b/runtime/docs/gc.md
index 1daea96..dc35cb5 100644
--- a/runtime/docs/gc.md
+++ b/runtime/docs/gc.md
@@ -1,6 +1,6 @@
 # Garbage Collection
 
-The Dart VM has a generational garbage collector with two generations. The new generation is collected by a parallel, stop-the-world semispace [scavenger](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/scavenger.h). The old generation is collected by concurrent-[mark](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/marker.h)-concurrent-[sweep](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/sweeper.h) or by concurrent-mark-parallel-[compact](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/compactor.h).
+The Dart VM has a generational garbage collector with two generations. The new generation is collected by a parallel, stop-the-world semispace [scavenger](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/scavenger.h). The old generation is collected by concurrent-[mark](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/marker.h)-concurrent-[sweep](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/sweeper.h) or by concurrent-mark-parallel-[compact](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/compactor.h).
 
 ## Object representation
 
@@ -37,7 +37,7 @@
 
 Any non-GC thread or task that can allocate, read or write to the heap is called a "mutator" (because it can mutate the object graph).
 
-Some phases of GC require that the heap is not being used by a mutator; we call these "[safepoint](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/safepoint.h) operations". Examples of safepoint operations include marking roots at the beginning of concurrent marking and the entirety of a scavenge.
+Some phases of GC require that the heap is not being used by a mutator; we call these "[safepoint](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/safepoint.h) operations". Examples of safepoint operations include marking roots at the beginning of concurrent marking and the entirety of a scavenge.
 
 To perform these operations, all mutators need to temporarily stop accessing the heap; we say that these mutators have reached a "safepoint". A mutator that has reached a safepoint will not resume accessing the heap (leave the safepoint) until the safepoint operation is complete. In addition to not accessing the heap, a mutator at a safepoint must not hold any pointers into the heap unless these pointers can be visited by the GC. For code in the VM runtime, this last property means holding only handles and no ObjectPtr nor UntaggedObject. Examples of places that might enter a safepoint include allocations, stack overflow checks, and transitions between compiled code and the runtime and native code.
 
@@ -59,7 +59,7 @@
 
 During the marking phase, the collector visits each of the root pointers. If the target object is an old-space object and its mark bit is clear, the mark bit is set and the target added to the marking stack (grey set). The collector then removes and visits objects in the marking stack, marking more old-space objects and adding them to the marking stack, until the marking stack is empty. At this point, all reachable objects have their mark bits set and all unreachable objects have their mark bits clear.
 
-During the sweeping phase, the collector visits each old-space object. If the mark bit is clear, the object's memory is added to a [free list](https://github.com/dart-lang/sdk/blob/master/runtime/vm/heap/freelist.h) to be used for future allocations. Otherwise the object's mark bit is cleared. If every object on some page is unreachable, the page is released to the OS.
+During the sweeping phase, the collector visits each old-space object. If the mark bit is clear, the object's memory is added to a [free list](https://github.com/dart-lang/sdk/blob/main/runtime/vm/heap/freelist.h) to be used for future allocations. Otherwise the object's mark bit is cleared. If every object on some page is unreachable, the page is released to the OS.
 
 ### New-Space as Roots
 
diff --git a/runtime/docs/index.md b/runtime/docs/index.md
index e446544..934ea63 100644
--- a/runtime/docs/index.md
+++ b/runtime/docs/index.md
@@ -376,7 +376,7 @@
 
 ![AOT IC: dictionary](images/aot-ic-dictionary.png)
 
-[what-is-kernel]: https://github.com/dart-lang/sdk/blob/master/pkg/kernel/README.md
+[what-is-kernel]: https://github.com/dart-lang/sdk/blob/main/pkg/kernel/README.md
 [pkg-front_end]: https://github.com/dart-lang/sdk/tree/master/pkg/front_end
 
 ## Runtime System
diff --git a/runtime/docs/types.md b/runtime/docs/types.md
index a14ba1b..181debf 100644
--- a/runtime/docs/types.md
+++ b/runtime/docs/types.md
@@ -1,6 +1,6 @@
 # Representation of Types
 
-The Dart VM keeps track of the runtime type of Dart objects (also called *instances*) allocated in the heap by storing information in the objects themselves.  Heap objects contain a header and zero or more fields that can point to further objects.  Small integer objects (*Smi*) are not allocated as separate instances in the heap, but appear as immediate fields of instances. They are identified by their least significant bit being zero, as opposed to tagged object pointers whose least significant bit is one.  Refer to the document [gc.md](https://github.com/dart-lang/sdk/blob/master/runtime/docs/gc.md) for a description of objects and tagged object pointers.
+The Dart VM keeps track of the runtime type of Dart objects (also called *instances*) allocated in the heap by storing information in the objects themselves.  Heap objects contain a header and zero or more fields that can point to further objects.  Small integer objects (*Smi*) are not allocated as separate instances in the heap, but appear as immediate fields of instances. They are identified by their least significant bit being zero, as opposed to tagged object pointers whose least significant bit is one.  Refer to the document [gc.md](https://github.com/dart-lang/sdk/blob/main/runtime/docs/gc.md) for a description of objects and tagged object pointers.
 
 ## Runtime Type of an Instance
 
@@ -27,7 +27,7 @@
 
 ## AbstractType
 
-The VM declares the class `AbstractType` as a placeholder to store a concrete type. The following classes extend `AbstractType`: `Type`, `FunctionType`, `TypeParameter`, and `TypeRef`. The latter one, `TypeRef` is used to break cycles in recursive type graphs. More on it later. `AbstractType` declares several virtual methods that may be overridden by concrete types. See its declaration in [object.h](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.h).
+The VM declares the class `AbstractType` as a placeholder to store a concrete type. The following classes extend `AbstractType`: `Type`, `FunctionType`, `TypeParameter`, and `TypeRef`. The latter one, `TypeRef` is used to break cycles in recursive type graphs. More on it later. `AbstractType` declares several virtual methods that may be overridden by concrete types. See its declaration in [object.h](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.h).
 
 ## TypeArguments
 
@@ -145,7 +145,7 @@
 D<D<D<T>>>: D[D<D<D<D<T>>>>, D<D<T>>]
 ...
 ```
-The representation is divergent and therefore not possible. The VM detects non-contractive types (search for `ClassFinalizer::CheckRecursiveType` in the [class finalizer](https://github.com/dart-lang/sdk/blob/master/runtime/vm/class_finalizer.cc)) and reports an error. These non-contractive types make no sense in real programs and rejecting them is not an issue at all.
+The representation is divergent and therefore not possible. The VM detects non-contractive types (search for `ClassFinalizer::CheckRecursiveType` in the [class finalizer](https://github.com/dart-lang/sdk/blob/main/runtime/vm/class_finalizer.cc)) and reports an error. These non-contractive types make no sense in real programs and rejecting them is not an issue at all.
 
 ## Compile Time Type
 
@@ -216,7 +216,7 @@
 
 ## Finalization
 
-Types read from kernel files (produced by the Common Front End) need finalization before being used in the VM runtime. Finalization consists in flattening type argument vectors and in assigning indices to type parameters. A generic type provided by CFE will always have as many type arguments as the number of type parameters declared by the type’s class. As explained above, type arguments get prepended to the type argument vector, so that the vector can be used unchanged in any super class of the type’s class. This is done by methods of the [class finalizer](https://github.com/dart-lang/sdk/blob/master/runtime/vm/class_finalizer.h) called `ExpandAndFinalizeTypeArguments` and `FillAndFinalizeTypeArguments`.
+Types read from kernel files (produced by the Common Front End) need finalization before being used in the VM runtime. Finalization consists in flattening type argument vectors and in assigning indices to type parameters. A generic type provided by CFE will always have as many type arguments as the number of type parameters declared by the type’s class. As explained above, type arguments get prepended to the type argument vector, so that the vector can be used unchanged in any super class of the type’s class. This is done by methods of the [class finalizer](https://github.com/dart-lang/sdk/blob/main/runtime/vm/class_finalizer.h) called `ExpandAndFinalizeTypeArguments` and `FillAndFinalizeTypeArguments`.
 
 The index of function type parameters can be assigned immediately upon loading of the type parameter from the kernel file. This is possible because enclosing generic functions are always loaded prior to inner generic functions. Therefore the number of type parameters declared in the  enclosing scope is known. The picture is more complicated with class type parameters. Classes can reference each other and a clear order is not defined in the kernel file. Clusters of classes must be fully loaded before type arguments can be flattened, which in turn determines the indices of class type parameters.
 
@@ -226,7 +226,7 @@
 
 The VM keeps global tables of canonical types and type arguments. Canonicalizing a type or a type argument vector consists in a table look up using a hash code to find a candidate, and then comparing the type with the candidate using the `IsEquivalent` method mentioned above (passing `kind = kCanonical`).
 
-It is therefore imperative that two canonically equal types share the same hash code. `TypeRef` objects pose a problem in this regard. Namely, the hash of a `TypeRef` node cannot depend on the hash of the referenced type graph, otherwise, the hash code would depend on the location in the cycle where hash computation started and ended. Instead, the hash of a `TypeRef` node can only depend on information obtainable by “peeking” at the referenced type node, but not at the whole referenced type graph. See the comments in the [implementation](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.cc) of `TypeRef::Hash()` for details.
+It is therefore imperative that two canonically equal types share the same hash code. `TypeRef` objects pose a problem in this regard. Namely, the hash of a `TypeRef` node cannot depend on the hash of the referenced type graph, otherwise, the hash code would depend on the location in the cycle where hash computation started and ended. Instead, the hash of a `TypeRef` node can only depend on information obtainable by “peeking” at the referenced type node, but not at the whole referenced type graph. See the comments in the [implementation](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.cc) of `TypeRef::Hash()` for details.
 
 ## Cached Instantiations of TypeArguments
 
@@ -249,5 +249,5 @@
 
 ## Nullability of TypeArguments
 
-The previous section ignores an important point, namely, sharing is only allowed if the nullability of each type argument in the instantiator is not modified by the instantiation. If the new instance was allocated with `A<S?, T>()` instead, it would only work if the first type argument in the instantiator is nullable, otherwise, its nullability would change from legacy or non-nullable to nullable. This check cannot be performed at compile time and performing it at run time undermines the benefits of the optimization. However, whether the nullability will remain unchanged for each type argument in the vector can be computed quickly for the whole vector with a simple integer operation. Each type argument vector is assigned a nullability value reflecting the nullability of each one of its type arguments. Since two bits are required per type argument, there is a maximal vector length allowed to apply this optimization. For a more detailed explanation, search for `kNullabilityBitsPerType` in the [source](https://github.com/dart-lang/sdk/blob/master/runtime/vm/object.h) and read the comments.
+The previous section ignores an important point, namely, sharing is only allowed if the nullability of each type argument in the instantiator is not modified by the instantiation. If the new instance was allocated with `A<S?, T>()` instead, it would only work if the first type argument in the instantiator is nullable, otherwise, its nullability would change from legacy or non-nullable to nullable. This check cannot be performed at compile time and performing it at run time undermines the benefits of the optimization. However, whether the nullability will remain unchanged for each type argument in the vector can be computed quickly for the whole vector with a simple integer operation. Each type argument vector is assigned a nullability value reflecting the nullability of each one of its type arguments. Since two bits are required per type argument, there is a maximal vector length allowed to apply this optimization. For a more detailed explanation, search for `kNullabilityBitsPerType` in the [source](https://github.com/dart-lang/sdk/blob/main/runtime/vm/object.h) and read the comments.
 
diff --git a/tests/language/instantiate_to_bound/README.md b/tests/language/instantiate_to_bound/README.md
index 0c24c51..a015f2e 100644
--- a/tests/language/instantiate_to_bound/README.md
+++ b/tests/language/instantiate_to_bound/README.md
@@ -7,6 +7,6 @@
 feature relies on another feature, _super-bounded types_, which is
 therefore also in focus for tests in this directory. For more details,
 please check the feature specifications on
-[super-bounded types](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md)
+[super-bounded types](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md)
 and on
-[instantiate to bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
\ No newline at end of file
+[instantiate to bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).
\ No newline at end of file
diff --git a/tests/language/void/README.md b/tests/language/void/README.md
index d2a17c9..ad7fa6b 100644
--- a/tests/language/void/README.md
+++ b/tests/language/void/README.md
@@ -7,4 +7,4 @@
 developers to express the intent that the value of certain expressions
 is of no interest, and help them to avoid using such values. For more
 details, please check the
-[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md).
\ No newline at end of file
+[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md).
\ No newline at end of file
diff --git a/tests/language_2/fixed_size_int/README.md b/tests/language_2/fixed_size_int/README.md
index a2ddb7c..6b768e9 100644
--- a/tests/language_2/fixed_size_int/README.md
+++ b/tests/language_2/fixed_size_int/README.md
@@ -4,4 +4,4 @@
 feature which changes the `int` type to have a fixed-size representation
 (as opposed to implicitly transitioning into an arbitrary bigint
 representation when needed). For more details, please check the
-[informal specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md).
+[informal specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md).
diff --git a/tests/language_2/implicit_creation/README.md b/tests/language_2/implicit_creation/README.md
index c6c3857e..0917226 100644
--- a/tests/language_2/implicit_creation/README.md
+++ b/tests/language_2/implicit_creation/README.md
@@ -5,6 +5,6 @@
 creation expressions and composite literals (maps and lists) to be
 omitted. For more details, please check the feature specifications
 on
-[optional const](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-const.md)
+[optional const](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-const.md)
 and on
-[optional new](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new.md).
\ No newline at end of file
+[optional new](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/optional-new.md).
\ No newline at end of file
diff --git a/tests/language_2/instantiate_to_bound/README.md b/tests/language_2/instantiate_to_bound/README.md
index 0c24c51..a015f2e 100644
--- a/tests/language_2/instantiate_to_bound/README.md
+++ b/tests/language_2/instantiate_to_bound/README.md
@@ -7,6 +7,6 @@
 feature relies on another feature, _super-bounded types_, which is
 therefore also in focus for tests in this directory. For more details,
 please check the feature specifications on
-[super-bounded types](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md)
+[super-bounded types](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/super-bounded-types.md)
 and on
-[instantiate to bound](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/instantiate-to-bound.md).
\ No newline at end of file
+[instantiate to bound](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/instantiate-to-bound.md).
\ No newline at end of file
diff --git a/tests/language_2/invalid_returns/README.md b/tests/language_2/invalid_returns/README.md
index 0a6738b..7ab657e 100644
--- a/tests/language_2/invalid_returns/README.md
+++ b/tests/language_2/invalid_returns/README.md
@@ -2,5 +2,5 @@
 
 This directory holds tests for valid and invalid returns from functions. See
 the
-[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md) for
+[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md) for
 details, or the formal spec once integrated.
diff --git a/tests/language_2/nosuchmethod_forwarding/README.md b/tests/language_2/nosuchmethod_forwarding/README.md
index bc759e3..ed26b01 100644
--- a/tests/language_2/nosuchmethod_forwarding/README.md
+++ b/tests/language_2/nosuchmethod_forwarding/README.md
@@ -5,4 +5,4 @@
 implicitly for all method signatures in the interface of a class that
 declares a non-trivial `noSuchMethod`. For more details, please check
 the
-[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/nosuchmethod-forwarding.md).
+[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/nosuchmethod-forwarding.md).
diff --git a/tests/language_2/void/README.md b/tests/language_2/void/README.md
index d2a17c9..ad7fa6b 100644
--- a/tests/language_2/void/README.md
+++ b/tests/language_2/void/README.md
@@ -7,4 +7,4 @@
 developers to express the intent that the value of certain expressions
 is of no interest, and help them to avoid using such values. For more
 details, please check the
-[feature specification](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generalized-void.md).
\ No newline at end of file
+[feature specification](https://github.com/dart-lang/sdk/blob/main/docs/language/informal/generalized-void.md).
\ No newline at end of file
diff --git a/tools/VERSION b/tools/VERSION
index 097fbeb..d35832b 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 15
 PATCH 0
-PRERELEASE 107
+PRERELEASE 108
 PRERELEASE_PATCH 0
\ No newline at end of file